The UK is tiny, why not just electrify the line?
Still requires a much higher initial investment along with maintenance. Which I believe will be harder to get approval for than just different trains. Another factor could also be that the tracks are maybe not owned by the train companies. Making it even more difficult to get any large investments in electrification approved.
From what I understand a lot of the UK rail network is reliant on old infrastructure, think Victorian era bridges/tunnels. These weren’t designed with rail electrification in mind so may not have room for a train and an overhead line for example. While there may be solutions for each individual instance of this sort of problem, solving them involves addressing each of them individually and takes more time and money than electrification would in a vacuum.