This depends on which models you are comparing to but both of these European manufacturers have been around since the early 1900s and have been producing very well engineered vehicles. However, BMW have been stepping up the pace in sales versus Mercedes.
I have only seen and heard good comments about their service and customer appreciation so far. However, Mercedes tend to be more classy and luxurious while BMW is a little more young and stylish. If you are talking about performance, both manufacturers have a series of high performance vehicle. Mercedes have their AMG series while BMW have their M series. But, BMW have a slight edge and is built more on performance compared to Mercedes.
In conclusion, Mercedes has a little more class, prestige, and luxury feel while BMW has a little more young, stylish, and track performance feel. BUT, in the end, I highly suggest that you road test both vehicles and decide on what you like so you don't regret it.