Both two sentences are correct. There are few differences between those two forms. "鼓劲" is more likely followed "加油",that is "为某人鼓劲加油", but "鼓励" can not. Chinese use "鼓劲" usually during a game or an activity, but use "鼓励" more widely and more often. e.g. if someone failed in business, we would "鼓励他不要气馁"。