I know "to get onto the train", but is it correct to say "to get into the train"? If so, when do we have to use it?
See @FumbleFingers comment for the typical answer, which is likely the one you're looking for.
With that said, "to get into the train" can still be perfectly correct in some cases.
"The replicators managed to breach the train hull, and are now trying to get into the train"
However, that is an exception. You would generally "board" a train, or get "onto" a train.