Yes, get off the train is the correct idiom. We also get off the bus and get off of the boat and get off the motorbike. But, we get out of the car. If you said I got out of the train, personally I might imagine you climbing out the top of the train, or escaping from a train that had crashed.