I think "the" is appropriate in every case I can think of, but in some cases "a" might be justified. A train leaving at 7 o'clock to a certain destination is going to be a specific train, if it is on a certain day, so it is "the 7 o'clock train to London". However, if it is not on a certain day, then a 7 o'clock train becomes one of several, so it would not be wrong to say: "When I go to London I tend to get a 7 o'clock train". However, there would still be a strong tendency to use "the" here too, in the sense of "the train that leaves at 7 on the day that I travel".
How about if you think of a large transit station where different lines going out in every which way, and there may possibly be two or more 7:00 train scheduled to leave? Would this be a case where you might use 'a' seven o'clock train?
You usually catch trains for a specific destination: you want the train to London; the 7.00 to London. If there were multiple trains leaving at 7.00 you would still want one specific one: the one to London; and if several go to London that day, you want the seven o'clock (train) to London.
One situation where we usually say 'a': if people go out for a drink or two after work, you might say you can't stay long, as you have to catch a seven o'clock train.
I have never heard of two trains for the same destination leaving at the same time.
However, when enquiring about trains, you could ask:
"Is there a 10 o'clock train to Exeter St David's?"
The reply could be "There's a 10 o'clock only on Saturday."
And you could say "I'd like a ticket for the 9 o'clock next Saturday."