Isn't that because the freight companies are the ones that actually built, own, and operate the tracks? If Amtrak or another passenger company owned the tracks, their trains would get priority.
Indeed, that, if anything, is exactly the kind of investments that a government should be making.
The government well made its money back before the great railway crash.
Let's say the Internet suffers a crash in a few decades. Few would argue that any previous investment into the Internet was not worth it.