That's why it's so important to know in advance what the route to San Francisco should look like, so that you can recognize early on if the train suddenly appears to have a different destination in mind.
Just make sure you double check your boarding pass before you get on. And keep your eyes on those guys in the First Class seats. Get off when they do. They won't ride to the end of the line. But if you do miss your stop, don't blame the conductor.
If the train pulls out of the station without you, don't chase after it. Wait for it to come back and pick you up.
And when you see passengers on the roof, and hanging out of the windows, you know it's near the end of the line.