If you’re going to pan along with the train, Mode 2. Else, Mode 1 (or 3 if you prefer, but 1 stabilizes the viewfinder which is often helpful with longer lenses).
Ahhh, language. I interpreted it as try the camera+lens on a moving train, as opposed to try the camera+lens on a moving train. Confusion between grammatical and photographic subjects, I suppose.
Canon describes the modes and their use cases here:
Learn about image stabilisation in lenses and cameras. Find out about how image stabilisation keeps the image static despite the movement of the camera.