This is correct. The motion of the people is relative to the Portal. It doesn't matter if the trolley is accelerating the Portal towards them or something is accelerating them towards the Portal. Therefore they accelerate out of the other side with some retained momentum. Technically it probably resembles something in between pictures A and B.
This reminds me of the experiment about whether an airplane could take off from a treadmill.