The level of train drivers' pay has little to do with the (numerous) challenges of the job, and everything to do with the basics of economics - supply and demand.
There is a continuous and relatively high demand for drivers, as train operators simply can't run any sort of service without them, and people continuously retire and move to other roles or companies. Crucially, there is also competition between train operators for qualified drivers, so operators would haemorrage drivers if they didn't pay competitively with other operators.
On the other side of the equation, it takes a long time to train drivers, and it's not possible to obtain or maintain the necessary competence unless you actually work for a train operator, so people can't just pay for their own training (as happens in the airline industry). Therefore, even though hundreds or thousands of people apply for each role, the supply is low.
High demand and low supply - together with unions ensuring that train drivers act in unison rather than as individuals - quite foreseeably results in high pay.
So it's not really a question of train drivers being "overpaid"; they are simply paid the market rate. And other roles have a lower market rate because the circumstances are different.
You might not agree with it morally, but this is simply a manifestation of capitalism in action!