Hmm.
First, I don't think momentum is conserved by portals (it is conserved relative to the portals, but not globally). Momentum is a vector quantity, meaning it's dependent on direction. Objects exit portals relative to the normal vector of the second portal. So momentum can be conserved depending on the arrangement, but it can also be "reflected" or rotate the momentum vector 180 degrees to itself before it entered the portal. However, since no momentum seems to be transferred to the portal or the surface it's on (think throwing a rubber ball against a brick wall, a little momentum is transferred to the wall to reflect it), it seems that momentum isn't conserved.
The thing that does seem to be conserved is "speed" (but not kinetic energy). The question now is "speed relative to what?" I think it's impossible to say for certain, there are a lot of arguments to be made either way, but I think the easiest answer is "your speed relative to the first portal you enter". So in this case, I believe the people would fly out of the second portal when hit by the portal on the train.
Another example to think about is a portal in a falling elevator. While it's in free-fall, how would someone exit the portal? I don't think they'd be shot out of the portal if they exited it, so portals likely conserve your speed relative to the portal you enter.
In this example you could also make a spaceship that runs off free energy engine, hence energy isn't conserved either. The spring mass is tossed to the front of the ship, hits the wall and bounces off (transferring a little of it's momentum). It then travels back relative to portal 1 with a speed greater than it's initial speed. Exists portal two, adding even more momentum (since it's moving faster), it bounces off again, and repeats the process.
Unless portals and the things that goes through them consume energy from the gun, portals violate conservation of momentum and energy.
