They are not always interchangeable. In your question you gave two examples. "The only one" is something you will see written and hear spoken very often. You would never see or hear "the mere one". It is not a correct use of the word.
"Merely" most often emphasises the lack of importance or relevance of a thing. Examples:
"The only important thing he said came first, everything was merely additional information"
"We know who will win, the rest are merely making up the numbers"