Answer
The ball falls back into the smokestack in the first case, and misses the smokestack in the second and third cases because the train does not keep moving in a straight line at constant speed.
Work Step by Step
If the ball is launched upward while the train is moving at constant speed in a straight line, its horizontal motion before, during, and after the launch remains the same as that of the train. The ball falls back into the smokestack. Please see Figure 2.19 on page 34 for a similar example of a coin tossed in an airplane.
If the train gains speed after the ball is launched, the ball will land behind the smokestack. The ball's horizontal motion continues unchanged along the original direction, in accordance with the law of inertia, while the train speeds up, and the smokestack pulls ahead of the ball.
If the train makes, say, a right turn while the ball is in the air, the ball will land to the left of the smokestack. The ball's horizontal motion continues along the original direction (in a direction tangent to the curve) in accordance with the law of inertia, and the smokestack veers off to the right under it.