One important qualifier to that statement is that railroads are granted the power of eminent domain. That make this process of negotiation So if they get to a point and there's a few property owners who absolutely refuse to sell for a reasonable amount, the railroad can either threaten to condemn their property to force the property owner to deal, or else just condemn the property outright and let the courts decide the cost. This is how the vast majority of railroads were built. I suppose that in some areas where the RRs were built across federal or state land, they may have gotten the right-of-way through a grant, but certainly in the Chicago area, railroads were built mostly across private property.The Galena & Chicago Union received no land grants. It indeed bought "continuous and straight rights-of-way extending across the amber waves of grain by tirelessly negotiating to acquire each individual parcel in a linear fashion."
The idea that railroads should have to give away free access to their rights of way simply because they are allowed to condemn property doesn't seem right to me.
I also seem to remember that there was an act passed, I think in the early 20th century, that absolved railroads of "owing" anything to the governments for allowing them to be built. Maybe it was part of the de-nationalization after world war 1, I'm not a history expert though so my memory could be off.