I don't think it's a fair comparison, a 3 series v's a E class, the Merc is the next size up (and my wife says size matters)
A 3 series v c class or 5 series v E class would be a better comparison.
You really need to think about your lifestyle & how your going to use the car? If you want practicality, loads of space and comfort then the Merc is the way to go. But you ain't going to chuck it around like the BMW.
Both engines are really sweet so that doesn't really come into it.
If I was spending your money or mine I'd have the Merc. I don't give 3 series estate's a second glance, But a Merc E class estate in something like white really catches my eye. Each to their own I guess