Answer: Suppose that the first astronaut is still in place, then the full momentum of that astronaut is zero.
Now, when the astronaut throws the ball, now the ball has momentum, so the astronaut moves in the opposite direction to conserve the momentum (the movement of the arm also creates a response in the body of the astronaut)
(all of this can be explained also by the third Newton's law, for example, the astronaut that accelerates the baseball also experiences a force that the baseball does in him)
Usually, in the earth, the force of gravity keeps the players in place, but in the space, this is not the case, so the tiny force that the ball does in the astronaut is enough to accelerate the astronaut.
It is the same for the other one, the ball comes with a little bit of momentum, so when he catches the ball, the momentum must be conserved, so the astronaut will move in the same direction that the ball was moving.