Railroad bridges are a real problem. The first railroad overpasses were built back before WW2 using tax incentives, CCC funds, or other tools for economic development. In some cases it was pressure from the cities by way of creating ordinances about train length, street blockage times, and even noise. The railroads have closed most of the local ordinance loopholes. Public funds are rarely if ever being spent on the railroads.
Many of these bridges are still in place. There is zero incentive for the railroads to do anything. The city, county, or state highway departments can force them to do nothing. Even if the governmental agency decides to bypass it at their expense, they would have to close, depending on the situation, the bridge being bypassed plus one (additional) grade crossing or If they left it open and rerouted the road across a new alignment, they would probably want to close two grade crossings. Why? They control (own) the vertical area over the trackbed. They use this to their advantage.
When we deregulated the railroads, we created a huge need for highways. Trucks shipments replaced rail shipments. Anyone who thinks the railroad is corporate and the freeway is for private use, doesn't look at the traffic. More of the traffic on rural highways and freeways is commercial, heavy trucks, company pickups, company cars. I can assure you the percentage of the taxes we spend on highways and freeways for the benefit of corporations and other businesses far outweigh those spent for personal vehicles, even if we consider the car traffic in the cities.