Great ideas.
Here are some of my thoughts, some of which leap frog the ideas that others have posted (thanks for the brainfood!):
1. Once on the train the PCs cannot physically leave.
2. The train is a sort of spiritual or soul trap, existing in between worlds (call it the Mists if it helps simplify things).
3. Escape is only possible by helping some of those on the train find "Final Rest". In this regard final rest can denote the breaking of the illusion (proving that the "traveller" is in fact no longer of this earth), helping the traveller find something (a memento perhaps), something akin to solving a riddle, etc. Once this is accomplished the PC receives some sort of token than allows them to continue through the proceeding railcars. Perhaps it's the traveller's original ticket (or maybe something completely esoteric just for that wtf PC moment), which the PCs need to present to the train conductor...who acts as a modified phantasmal killer/grim reaper who is impartial to the PCs until the PCs attempt to force their way past, in which they become horrendously aggressive!
4. Most the other passengers on the train (if you want to include them for social rp/filler reasons) are "red herrings". The PCs can fully interact with them, have extended conversations, argue, flirt, whatever, but at the end of the day they are just (!) geists/phantoms (that seem as real as the PCs themselves). Perhaps they are the victims of the train that could not figure out how to proceed and/or exit the train. Everyone would have a story, but only one (an original passenger?) possesses the key to advance. As the PCs make their way through the railcars, presumably towards the engine room, maybe the passengers become fewer in number (one empty car just for the creep factor!
)...?
5. If the PCs are slain on the train by the "conductor", then they become permanent passengers. At least, until they can explain their situation to the next unwitting passengers. With time, the PCs begin to forget what happened to them, making it harder and harder to explain their situation. A sort of memory recall would need to happen before they can make a request for the newly-arrived passenger(s) to help them. To them they are passengers with a (increasingly fabricated) destination...
6. The Engine Room. It's possible for the Dark Lord to be here, or it's entirely possible that the first passenger the PCs helped (that little orphan stowaway) was the Dark Lord, who is enjoying the game a little too much...(boy/girl who cried wolf-based backstory/curse?)
7. During the course of helping one of the passengers find final rest, the PCs are transported (misted) into the timeline of that passenger, equipped with only their own tickets that they originally received (for presentation to the conductor who, again, really really dislikes unscrupulous travellers!!). This alternative timeline allows them free access to the whole train, and allows the DM to open up the adventure possibilities/scale. Also doubles as a brainmuck feature.
Once the passenger finds rest the PCs receive their "passage token" (that needs to be presented to the conductor), and on to the next car/timeline they go. If they fail to produce the right token to the conductor then they are trapped in the passenger's timeline (on the train), and for added difficulty they might also risk a very scary attack for presenting the wrong token. Use your imagination. I'm thinking the librarian in Ghostbusters, only maxed...even beyond that scene in Raiders of the Lost Ark (opening the Ark) where the "angel" reveals her true nature!
I'll add more if/when they come to me, in the hopes that it'll get somebody's creative juices flowing.