You're implying that putting capital towards having the "best" railway is the most optimal use of that capital. I think it's much more complicated than that, and coincidentally, market mechanics are one way of crowdsourcing the decision of how capital is put to best use.
I'm not saying it's always the best solution and free markets going unchecked can for sure cause more harm than good, but I think you're making it out much simpler than it really is.