If we bring a floating balloon in a accelerated train, the balloon will move forward in the same direction as the acceleration as shown in the following figure.

However if a pendulum is hung on the train ceiling, the ball moves backward. We also get moved backward in the accelerated train.
Could you explain why the floating balloon behaves differently?