Same ball. Same motion. Two different observers see two different speeds — because velocity always depends on who's watching, from where.
The ball walks back and forth inside the train at a fixed pace relative to the train. But relative to the ground, its speed changes — it's faster when walking toward the front (same direction as the train) and slower when walking toward the back (opposite direction). The rule: velocities add, with direction (sign) taken into account.
Problem Solving Physics