Before passing, pressure near the noses of both train is very high.
they begin to pass each other, the air on the right-hand-side of train A
is pushed aside by train B. (streamline is very sparse).
Then train A is
pushed away from train B. But, when the overlap of train A and B becomes
large, pressure between both cars falls, and train A is pulled toward
Train B also has the same experience in this process.
pressure change is the source of rolling of Shinkansen trains.