Hi, J@p28al, thanks for sharing your experience here. That's good to know, although I'm sorry that it was not ideal for you. But hopefully that will help a later traveler who has questions about taking the train from Bath to York.
Next time, you might want to come here to the forum early and post your train route and get some advice. We have a number of UK residents and frequent travelers who are more than happy to share their time and expertise and know the train system very well. I've been to the UK four different times and I still come here with questions, especially about the trains. 😊
For example, you could ask the question, "I am traveling from Bath to York by train. What is the most efficient and easiest train to take?" Hopefully you would get a number of responses from some of the folks here letting you know that you do not have to go through London to get from Bath to York.
Another option is to use Google Maps just to get a starting reference. For example, when I went to Google Maps just now and keyed in York as my destination and Bath as my starting point and asked for directions using public transportation, Google showed me that there are a number of train routes that go through London, but it also showed me a CrossCountry route that goes from Bath to York without stopping in London.
Once you have that, you could come here and ask for more details on it, or just go to the CrossCountry website and look for more information about that route. And as Johnnew52 mentioned above, you could have taken a train to Bristol and then a direct route to York from there. So there are lots of options. 😊