"Definitely" in practice is more certain than "certainly". "Certainly" is more often used when granting a request.
Think of "definitely" as "This is true or will be with no doubt whatsoever," and "certainly" is more like "This is true or will be."
An example would be, "Do you think you will win the race?"
You could answer "Yes, definitely". This would mean "There is no doubt in my mind, and I am completely determined to win."
If you answer "Yes, certainly," you would be saying "Yes, I will win."
If someone asked "Will you please go to the store?"
You could say "Yes, certainly". You are saying "Yes, I will."
If you answered "Yes, definitely," then you are saying "Yes, I absolutely will." This would imply you are not simply granting the request, but that you have an additional good reason to believe that it will happen. (Perhaps you have forgotten to go to the store previously, and you are determined that this time you will remember to go.)