Answer:
One would need to know how far apart the towns are:
T = SA / 40 time it takes for first cyclist to travel S1
T = SB / 60 time it takes for cyclist B to travel distance S2
SA + SB = S the distance between the towns
SB = 60 / 40 SA = 1.5 SA
SA + 1.5 SA = S
S = 2.5 SA where cyclist travels distance SA
The time will depend on the separation of the towns.