The main assumption is that the ball followed the same way uphill and back, so it was at the same initial point when it rolled back 4 m.
At this moment the displacement was zero (remember that the displacement is the difference between the final position and the initial position).
From that point the ball displaced other 24 m down (28m - 4m = 24 m). And, that is the magnitude of the ball's displacement.
Answer: 24 m.