I don't know about southbound (why wouldn't they just clear at the Vancouver train station?) but northbound, the Amtrak staff does a passport check when you board, and they just submit this to Canada customs. Perhaps if they need to remove someone they stop, but I don't remember my train...