Dot4 isn’t all equal, it’s a vague recipe and a minimum dry and wet boiling point.
Typically 5.1 will have a higher wet boiling point, which makes it better suited to cars where the owners might not change it very often (should be every other year) but the additives that increase the wet boiling point suppress the dry boiling point, so if you bleed them regularly and they’re well sealed (compared to car/motor bike systems which are pretty much open to the air) then dot4 can be better.
Which is why some racing car/track day/kit car users still use stuff that meets the DOT 3 spec (but change it regularly).
But fort all practical mountainbike purposes, it makes no difference (when did you last actually boil the brakes (not expand the fluid pumping the lever out a bit, actually boil it so the fluid pisses out everywhere and the lever pulls to the bar).