During roll,there is a vertical component of lift that keeps the plane in the air and an horizontal component that actually rolls the plane,how are wing ribs designed to help withstand this vertical(now sideways to ribs) lift force since wing ribs are inherently weak laterally?
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.