Yes, it is straight-line motion. The track in Fig. 4.6 is a straight (though sloping) line, and the ball stays on it throughout — so the path is a straight line.
Yes, it can be shown on a line like Fig. 4.3. The motion is one-dimensional: one number (the distance along the track from O) fixes the ball's position completely. Drawing that number line horizontally on paper is only a convenience — the line stands for the track itself, and the positive direction along it is "down the slope from O towards D", not "horizontally to the right".
Reading the markings of Fig. 4.6 along the track: OA = 40 cm, AB = 10 cm, BC = 20 cm, CD = 30 cm. So the positions measured from O are
So at A, B, C and D the two are equal.
Why it happens: the ball moves down the incline in one direction only and never rolls back up. With no reversal, the path is the straight line joining the two positions, so its length equals the straight-line gap. The direction of the displacement, however, is along the incline — pointing down the slope — and not horizontal.