UK train tickets are among the most expensive in Europe; this image below from The Telegraph is quoted a lot of times in the press and on social media trying to show the disparity with other European countries for:
While it does include a lot of cherry-picking, and doesn't really address why train fares are so expensive (which is still up to debate both by politicians and the general public), it does show that high rail prices are something that you can expect in the UK. Also prices are usually increasing each year as well usually with higher rates than inflation.
Air travel in comparison, especially on low cost airlines is still cheap, it's much more common that low and ultra-low-cost airlines like RyanAir or WizzAir will try to charge you on the extras instead of the plain ticket prices. Also don't forget that although the rail system in the UK is privatised there's not really many competition between the rail companies, as each of them only serves part of the country - there's only a handful routes where you actually have the option to pick between multiple train companies - meaning there's also less of a competition between them to decrease prices. Flight companies however do operate on the same route - meaning there's more competition between them that can affect their prices.
However there are some ways you might be able to get cheaper rail fares.
Use routes that are served by one specific train company
Railway in the UK is privatised and there are multiple train companies operating in the country on a franchise basis. Some companies are only providing train travel on a small part of the country, but some others like Virgin, LNER or CrossCountry operate long-distance trains as well.
When checking routes if you are lucky enough that your trip is served by only one company, then you might be lucky, as they usually have advance tickets for sale. However if the route is served by multiple companies (as you have to switch trains at some point) the price will be dependent whether both of the sections have a cheaper advance ticket, or not.
For example a trip from London to Aberdeen would only include travel on LNER trains - meaning LNER alone could give you a bargain price on an advance off-peak single ticket. However a trip from Manchester to Aberdeen includes multiple companies - likely the Transpennine Express from Manchester to Glasgow, then either CrossCountry or ScotRail to Aberdeen.
It's possible in this case that only the section from Manchester to Glasgow is on sale, or only the section from Glasgow to Aberdeen is on sale. It's also possible that there's a cheaper ticket if you wait a few hours in Glasgow - but these options will not show up on a normal booking page, only the more expensive fare. However some sites like trainsplit.com does search differently, and will allow you to buy separate tickets for the separate legs potentially driving costs down even more.
Also note that although you can book tickets on any train company's website (even for routes that are not served by them) when you have a "single company route" booking on that particular company's website might also get you some extra benefits. For example there's free wifi on LNER trains if you book the ticket on the LNER site, otherwise it's around £3
Book in advance
Also book off-peak or super-off-peak tickets, and book non-refundable tickets that are only valid to one specific train. Similarly to plane tickets the more flexible they are the more expensive they get. Also similarly to them the prices of advance rail tickets might also go both up and down, so it might not always be worth booking too far in advance.
Advance tickets might not always be available - some train companies don't sell them for example at all, as they only have plain peak and off-peak tickets. This can be relevant on routes which are only served by changing trains and train companies.
If there are advanced tickets, for both the outward and return journey then they can be cheaper than an anytime return ticket.
Railcards will give you 1/3 off the price of off-peak tickets. For long distances if you travel with someone a two-together railcard might sometimes make the trip cheaper than the cost of the railcard itself (£30, and you can use the railcard for subsequent travels in the year as well).
If you're travelling alone or in a group you might be able to find other railcards that can help you drive the cost down, especially if you're either a Senior, or younger than 30 years old.
Don't forget that air travel is usually not that simple
Airports are usually not centrally located, and the transfer from the airport to the city can easily add a lot to the cost of the ticket. Trains usually depart and arrive to the city centre. The transfer ticket from the airport to the city can easily get into the £10-£20 range in some locations, especially London.
Usually only small cabin bags are included in the air fare (and in case of RyanAir they are now only allowing really-really small bags without paying extra). Any additional bags need to be bought separately - which can add to the total cost of your trip. Also no liquids in bottles measuring more than 100ml, unless you pay extra for putting your bags in the hold. On trains both the baggage allowance and what you can bring onboard is much more relaxed.
The transfer, check-in, security and baggage reclaim can actually take a substantial time, which might easily eat away a lot of the time gained by the shorter fare time.
I usually do the Edinburgh-London trip, and usually I have a choice between using an LNER train to London or by finding some cheap tickets from
Edinburgh Airport to London Stansted.
I can usually find train tickets in the £60-£120 price range each way, while air fares are usually between £20-£100. When I can find something in the £20-40 range I usually opt for that, but above it, the extra hassle with baggage (£10-£15), airport transfer (£10-£20) and security means I am usually better off with a £80-£100 train ticket.
Time wise they are also comparable: although the plane flight only takes an hour, I also have to get to and from the airport which can take up to an hour in both Edinburgh and London, and there's still check-in, security, and baggage reclaim, which can easily add to a total of 4 hours, which is almost the same as the the 4.5 hours trip for the train - and on the train there's at least free wifi.
And both of them are usually delayed as well.