All of the terrain variation in the Mario sequels is still built out of straight lines.
All of the 2D games’ terrain variation, yes. And?
the most running speeds he has is three, which means the game puts very specific boundaries around the speed and ability to gain momentum.
Which would be a problem if the chief aspect of Mario centers around speed and momentum. But it doesn’t. Mario can also fly, shoot fireballs, duck, punch, butt-stomp, triple-jump, wall-jump, et al.
Speed and momentum are not the primary aspects of Mario games as they are with Sonic. So arguing that physics in Sonic are superior is rather an apples to oranges comparison since the platforming is wholly dissimilar.