Both train line and open access leach money out of an industry that requires massive subsidy.
There are arguably benefits to their existence, but they only exist to make profit.
This is a total myth, mainly perpetuated by uninformed staff who have no idea beyond their own front line duties.
A significant number of passengers would simply not travel by train if the Trainline did not exist. Thinking that these customers would simply switch to a TOC owned app is for the birds. Trainline makes rail easily accessible with a fantastic mobile experience for 99% of the people who just want fairly simple tickets, although limited split ticketing is supported, but at such a level that it is also fairly easy to comprehend. Their app is constantly one of, if not the, highest rated on the various app stores in it's category.
Trainline is essentially a huge advertising organisation - they spend most of their money on advertising and search engine optimisation - they're making wafer thin margins from the ticket sales, so it's all about boosting volume, and genuinely encouraging new people to rail.
I would bet the house that Trainline's total spend on advertising eclipses the advertising budgets of all of the TOCs combined each year - all to attract and retain customers - the operators do extremely well on the back of this. You have a travel agent essentially bringing all of this custom to your network for a tiny fee.
Then consider how much digital infrastructure Trainline provides - most TOC apps are powered by Trainline. Most business travel software is provided by Trainline. This can be surprisingly cost effective for TOCs, as Trainline has already built most of the functionality for their own website. It makes me chuckle when staff complain that customers booked through Trainline, when booking through most TOC apps would be using exactly the same booking engine, and the same support team behind the scenes.
Then consider all the fraud/revenue protection work undertaken - TOCs are getting far more than just a booking engine.