Answer and Explanation
The ball rolls to the back of the wagon since the force of motion is only applied to the wagon, not to the ball, hence, it will stay at rest relative to the ground which relative to the wagon means the ball rolls backward.
Newton's first law states that: An object at rest will stay at rest unless acted by a force to accelerate it.