The train won't leave before the published departure time; you can count on that. You should plan to be back on board a few minutes beforehand, though. As long as you can get back by that time, you're fine.
(There are a few exceptions to this rule, mostly stations where they only detrain passengers. Since no one is getting on, they don't have to wait.)
Where people get in trouble is assuming the layover time (34 minutes) will stay the same if the train is late. The departure time is 10:45pm; if the train is late they will still try to leave as close to that as possible, even if that's less that 34 minutes.