Neither, and he finally got it right. ( For the first sentence, I nearly wrote “he finally got it right in the end.” Do you know what’s wrong writing it that way? Answer at the end of the post.)
Yup, not a figure of speech at all.; it’s plain old text.
PS—Answer: Using both “finally” and “in the end” is needless repetition, a pleonasm.