To compare m54 to S54 you should look at torque.
S54 gets it's power from revs, but torque shows potential.
That said the s54 probably still is the better performer as it also has a longer stroke.
But high revs and long stroke seem to have some impact on lifespan from what I read...
Nobody revs the m54 as high as the s54; the s54 has a lot of features for high revs; the racing heritage shows in the mechanics, in both performance and lifespan.
M54 has been tuned to 800whp/881Nm wtq by the way (obviously with extensive mods
) by some swedish tuner.