That works to a certain extent but brings up other issues - political ones.
If the local reps are in the party in power or are trading an important vote, then your state/community can get "tracks to nowhere", faster tracks, freight bypasses, bigger and longer sidings, etc. Otherwise, you may find yours are abandoned, downgraded, rarely repaired, bumpy, etc.
If the states have to share in the cost, some won't care that long distance freights or passenger trains need features you don't want to pay for. Unlike auto traffic, most rail is long distance and who in Montana cares that trains are slow when they may mostly consist of Chinese goods moving to Chicago. The only concerns are local farmers, mines, etc.
There is no "dispatching" to speak of on highways except in a few congested areas. So dispatching also needs to be government owned.
Just like the issue of privatizing vs government employees elsewhere, this issue will constantly arise.
The "cost" of maintenance and capital spending will become a more noticeable issue and people are less likely to support a budget that, in most cases, has little direct affect on them locally as do highways. That's why certain groups fight defense spending and others fight social spending. "I don't need it so why are we paying so much for it?" syndrome.