My pick would be the Trek. The components are one step up from what is on the Merida, although you probably would not be able to tell the difference until you have a lot of miles on the bike. The lower grade components would start to wear a little more quickly than the higher grade components and you would need to adjust them more often. Beyond that, I don't see much difference in them.
If possible, you should test ride both bikes and then base your choice mostly on how you feel riding the bike. Everyone has their own opinion of the order of what features are most important on a bike. One person may give you glowing reviews on a bike that they really liked and then when you ride it, you might really hate it. Other riders can give your their impressions of good or bad rides, but make your choice on your own riding experience.