Rails need constant work to keep them in good condition. So does the ballast. Signalling involves miles of cables, lights, radio towers and motors that also degrade. The stations need staff, gates, ticket kiosks, displays.
A frequent need is to add capacity. Adding capacity to the sky is easy because it's empty. It's essentially just about scaling air traffic control systems. Adding capacity in a rail line can involve major earthworks, rebuilding bridges, totally replacing the signalling and so on.
Roads are easier to maintain and pay for themselves without subsidies just via fuel tax. There's no station infrastructure. No stations means no expensive employees. People drive cars themselves and cars can be driven safely even on quite degraded roads. Signalling is entirely local and so doesn't require much cabling, on high speed routes (motorways) there's usually little or no signalling required. Laying tarmac is much cheaper than laying rails. Finally of the few people needed to maintain and run the roads, many are private sector and un-unionized e.g. gas station employees. The government employees only do repairs and so don't have much strike power. Contrast to the railways which in Europe are frequently shut down for weeks at a time by strikes of drivers or crew.
The capital investment in trains is worth it for only one reason - it's the highest capacity form of transport in seats per hour. It's got nothing to do with greenness which is at any rate a very ambiguous case to make when you consider all the factors. Trains can be less green than planes in many ordinary situations.