I have driven all three ( + the 545 ), and can say that the M5 is by far the King in this trio.
545 are slightly faster, than 535, accelerating from 100km/h to 200 km/h ( tested under real conditions ), 535 has brutal torque and puts up a really good fight on the autobahn. Just back from a 4000km drive there with me in my M5 and my friend in his 535. Had a hard job loosing him on the stretches.
535 consumes half of what the M5 drinks at high speed!! Stop for refuelling and the 535 is gone.
B5 is like an AMG ( = not good IMO ), very fast in a straight line. Actually slightly faster than the M5, but there the good things stop. M5 is better in all other aspects IMO ( steering, brakes, hadling and all over feeling ).