... Usually on the best land they were gifted for building the railway line on the first place, so heavily subsidized as well
It was a real subsidy, but it was small and it was > 100 years ago.
OTOH, the land the freeways and roads were built on already had significant value before it was expropriated for road construction and wasn't paid for with diesel tax revenue, so it's yet another subsidy for truck traffic.