Both frames are made in Asia. If you got better components on the Merida than the Trek and if the frame materials are the same on both bikes then I would give the edge to the Merida.
FYI- Merida is the second largest producer of bicycles in the world behind Giant.