Someone else is telling me that they just respawned and continued riding. So...I guess that's what happens. Was on my way, but now...that just makes too much sense to not be right XD
Tried this once also. Logged out while inside a moving train. I also recall being brought back to the station where I brought my ticket. Maybe it depends on how far away you are from where you originally boarded.
I also tried activating the "Numinastic hustle" quest (the one where you collect 30 quoins for 30 seconds) while inside, just to see of it would give me the same results. After the quest, I was still onboard the train, still at the exact location where I activated the quest.