Most countries have a bit of slack built into long distance train times. From Basel to Amsterdam I always have time to get out in Cologne to get a bratwurst

(they have really good ones under platform4) and nip into the shop for 2 bottles of beer and get back on. In some town in Russia we jumped out legged it into the station sat down and had lunch and still had time to take some pictures before we set off.