"It is necessary that two balls slamming into wall is the same thing as two balls slamming into each other": this is not so obvious to me. However, the answerer says: "But now look at this in a train which is moving along with one of the balls before the collision. In this frame of reference, the first ball starts out stopped, the second ball hits it at $2v$, **and the two-ball stuck system ends up moving with velocity $v$**". Probably, the train is moving with velocity $v$, so the velocity of one of the two balls is $v+v = 2v$, whereas the other ball is moving on the opposite direction, so…