Taxis get maintained religiously, and taxi companies have no problem replacing worn parts or even entire engines.
There is a big difference in build quality and longevity between modern Mercedes cars and the ones built in the 1970s and 1980s. They used to feel substantially better than other cars. Now they don't really, except for the S class.
That’s a good point. A lot of taxis in Germany are owned by individuals (so while it’s still a business, it’s often a one-person business), but I know they have workshops specifically for taxis, that are probably somewhat specialized on Mercedes. And maintenance packages that factor into the price, which Mercedes likely has if only because of their long tradition as a taxi brand, would play a role as well. Otherwise, I would still expect taxi concession owners to go with the most reliable brand, because any maintenance cost still has to be subtracted from your profit.
Note that Germany has some pretty strict requirements on what a car needs to have in order to be used as a taxi. Going non-standard in your choices there is probably not worth it financially in the end.
There is a big difference in build quality and longevity between modern Mercedes cars and the ones built in the 1970s and 1980s. They used to feel substantially better than other cars. Now they don't really, except for the S class.