The Schengen Area is a Passport Union, which means there are no passport checks between the countries, just a passport check on entering and leaving the Area, with the rules for who gets in agreed between the countries.
Map of Schengen Area here: https://1.bp.blogspot.com/--jIBKY6VdsY/VtisrS9x6tI/AAAAAAAAA4I/_leAxgJTLkY/s1600/schengen-countries-map-2016-03.png
There is normally nobody at Schengen internal borders, the train (or bus or car) does not need to slow down.
"So if I'm a US resident and not a European citizen, I should have my passport stamped, right?" - no, because there is nobody at the border, they've all been made redundant. Instead non-Schengeners have the "90 days in any 180" limit for the whole of the Schengen Area.
Sometimes the police do random (or targetted) ID checks, like they do anywhere, for example during the refugee problems a few years ago.
The Schengen Area was designed for the benefit of the inhabitants. EU and Schengen Area citizens can travel to other EU/Schengen countries without restriction or time limit. Checking ID's on borders became a huge waste of time and money, as 99.9% of the border crossers had no restrictions or stamps. So they re-deployed all the border guards to the Schengen External borders, made some redundant, and imposed a common rule for non-Schengeners: "90 days in any 180".
But, your geography worries me "Prague to Munich train crosses into Austria and Italy." - Prague to Munich you travel directly from the Czech Republic to Germany, NOT via any other countries.