Every 12 minutes, rider A reaches the start (that is, 12, 24, 36, ...)
Every 18 minutes, rider B reaches the start (that is, 18, 36, ...)
Then, rider B takes the same amount of time to finish 2 laps compared to rider A finishing 3 laps.
Thus, they will meet again after 36 minutes.