Salaries don't tend to be strongly correlated with bad working conditions or stress. In most industries (like software development) it's just supply and demand, and I imagine there are more people willing and able to work for £65k as a train driver than as a software developer. It's a bit different for train drivers because of the strong unions; my guess is that explains their high salaries more than lack of supply.
(Median total reward for TOC train drivers is £66,043) https://www.orr.gov.uk/sites/default/files/2022-10/review-of...