How do wing ribs withstand lateral lift force?
TL;DR: from the ribs perspective nothing changes.

Look at the three figures you posted: the lift is always straight in the middle of the aircraft. Tilt the aircraft, the lift tilts with the aircraft.

From the perspective of the ribs there is no side force, the lift is still perpendicular to the wings (actually, to the incoming airflow, but is a good approximation).

The only case where the wings will see some side force is when the aircraft is in a sideslip, i.e. $\beta \neq 0$.

In such a situation is not the ribs that carry the side load, but the wing beams, that run along the whole wing.