Can you please help me point out the difference between "I was travelling by train and I was travelling on the train"?

Thank you very much.

2 answers

I was travelling by train.
Either is correct and mean about the same.

. . . traveling by train emphasizes a means of going somewhere

. . . traveling on the train emphasizes the person's physical presence inside the train