Ex1:
I only want to play video games.
I merely want to play video games.
In this case, "merely" doesn't work quite as well when trying to say that I want to play video games and do nothing else.. "only" does better at conveying exclusion.
Ex2:
For merely two dollars more, you can upgrade to the next size.
For only two dollars more, you can upgrade to the next size.
In this case, "merely" does a better job of including a feeling of the bare minimum.. the absolute, least amount required.
Beyond that, there is no difference. But again, "merely" is better at describing the least amount needed, whereas "only" is better at illustrating exclusion.
I hope this makes sense. All the best!