I currently live in an old railroad town in the Northeastern U.S. Our rail system is still alive and well out in this part of the U.S. -- despite the appearance of being a dinosaur in many other parts of the country. (I even take commuter rail in to work each day ... and yes, it's a full size locomotive with multiple passenger cars, including a couple of double-decker cars.)
I don't see how employee turnover has a lot to do with trains OR trucks winning the battle of who gets used to haul freight around? The real bottom line is going to be economics and efficiency. The big advantage I see trains having right now is better efficiency, in the sense that today's locomotives are pretty energy efficient. Many of the new ones have solar panels on top of them to augment power generation, and they move a MUCH larger volume of product around than a truck can. (In the case of passenger rail alone? Look how many hundreds of vehicles are taken off the roadways each weekday just from all of us who use it to commute instead of driving ... and that's just ONE of several rail lines out here that run each day.)
They also have an advantage in the fact that they don't have to deal with traffic congestion. The established railways are generally about the fastest way from point to point, so they can generally predict down the minute how long it will take to arrive at a particular stop.
IMO, there's a lot of mismanagement with the rail system, which allowed the trucking industry to eat their lunch in many cases. But it didn't HAVE to be that way.
EG. I used to work for a steel fabrication place that had a railway running right outside their back door. Up through some time in the 1970's, they always used the rail system to ship steel beams to customers. But they started running into logistics problems where customers were only willing to buy from them if they could meet deadlines for "rush" deliveries (and would pay big premiums for this as well!). The railroads couldn't adapt to accommodate this, especially when they'd often have their own logistics battles to fight, trying to get certain cars unloaded on a train before others. (They said they'd often see the train they were waiting on to pick up a load chug right on by, once or even twice, during the day, before finally stopping for them -- all because the railroad wanted to unload something else first and potentially juggle the train cars around in a yard, before coming back for the pickup.) All of that convinced them to invest in a small fleet of trucks and do their own deliveries.
But in any case? I think autonomous trucks probably will arrive before autonomous passenger cars owned by individuals. (Commercial vehicles could absorb the initially higher cost to purchase them, for one thing.) But you'll probably see them limited to driving in a designated lane, at least initially. Doing this would make their operation a little more like what the railroads do now .... follow designated paths from place to place. I'm not sure how well that will work for them, if they STILL have to have a "short haul" truck pick up their loads at some point and take them to the loading docks at their destinations, using the regular road system?