Depends on the degree of automation. It's a messy issue, but mostly infrastructure related. IMO 2050 is a reasonable guesstimate for majority of train driving in developed world to be automated. It's pretty normal for isolated many (i.e. no level crossing) commuter systems and subways to be on various levels of ATO now. The driver just operates the doors and says when to go.
Things get more interesting when you have fully autonomous trains existing on a proper network rather than segregated lines. That's harder to centrally automate and integrate with signalling and some future systems may rely on train to train communication (e.g. like ATACS).
Likewise is the case for freight railway automation. For mining railways (e.g. Rio Tinto, IOC, Muskingum Electric Railroad), the isolation makes it a lot easier as per above, as would I imagine the likely larger time constants involved with slower trains.
Now, the other curious one is performance. Most ATO systems, especially commuter ones tend to be pretty "dumb" in the sense that they don't really fine tune how the systems respond to timetabling and acceleration, more push and shove than anything. AFAIK the only somewhat "smart" one is the Hitachi fuzzy control system on the Sendai Subway which has been studied for its smoother acceleration and energy savings over human driving, although curiously the stopping accuracy is rather "human" in the sense that there's a lot more variance than what one would expect.
Some may fight it tooth and nail, but it's inevitable as with many industries and it's going to hurt when it comes. Though it's still some time away, I imagine if it was given the same attention and funding as autonomous road vehicles, it would all be automated by now.
If its so close why are locomotive freight engineers paid so much?
– Because right now they are the most versatile train control systems available.
there's also not many of them relative to revenue tonnage. trucks need one driver for every truck hauling ~20 tons, trains can move 10,000+ tons in one train with just two guys in the cab.