Train travel in the UK is absurdly expensive unless you're willing to book a few months in advance and travel off-peak. Train travel in Spain is much better and cheaper. AFAIK in terms of price it mostly has to do with how much governments are willing to subsidise rail transport.
Sadly when there was a plane option instead - that always tended to be way cheaper (London to Scotland for example).
Personally I'd subsidise it more on less used routes just to push people out of cars more, sadly London commuter routes have kinda hit the wall in capacity ad legacy limitations of the old layout/station platform lengths, rail gauge, bridge heights etc of which much was planned for in an era 100 years ago.