Originally Posted by sandra_w
do passengers stay onboard when crossing the US/Canadian border? thanks!

It's been many years since I've crossed the border by rail, but it was (and I think still) yes. The C&I officials board the train and check all the passengers. The only ones who get off, besides the C&I officials, are passengers being taken for more questioning. (This happens VERY rarely - I have never seen it!)
The one exception is Vancouver, BC for Amtrak to Seattle. There you clear Customs even before departure!