頑張って is "Hang in there!","Go for it!",I guess.
We say 頑張って to encourage someone to keep doing something or stick to something,while we say
元気だして more like to comfort someone.
For instance,I wouldn't say 頑張って to someone depressed because they must be feeling they can't keep moving on ,and I wouldn't want to push them.But I might say 元気だして to them.