Until the first meeting point, the first cyclist travelled the distance S1=v1, while the second cyclist travelled S2=v2. Therefore, the distance between towns A and B equals v1+v2. There are two possible cases.
Case 1. Before their second meeting, both cyclists reached their destination town, and turned around. Suppose their second meeting occurred at the distance S3 from town B and time t2 later after the first meeting (fig. 22). Then, we get the equations

Fig. 23
v2+S3=v1t2 and v1+(v1+v2−S3)=v2t2.
By adding these equations, we obtain
v2+S3+2v1+v2−S3=(v2+v1)t2⇒t2=2.
Case 2. Before their second meeting, the first cyclist reached destination town B, turned around and reached the second cyclist before he/she reached town A (fig. 23). Suppose their second meeting occurred at the distance S3 from town B and time t2 later after the first meeting (fig. 4). Then, we get the equations
S3−v2=v2t2 and v2+S3=v1t2.
Taking the difference of these equations, we obtain
v2+S3+v2−S3=(v1−v2)t2⇒t2=v1−v22v2.
Now, the only thing left is to figure out which of the two cases occurs for which v1,v2. Case 1 happens when the first cyclist reaches A later than the second cyclist, i.e. v1v2+v2+v1>v2v1⇒2v22+v1v2>v12. Let us denote x=v2v1, then it must satisfy the equation
x2−x−2<0⇒(x+1)(x−2)<0⇒x<2, i.e. v1<2v2.