The burning rate of the faster burner is L/2.5 cm/sec if the candle length L is measured in centimetres. The slower burner has a rate of L/5 cm/sec.
After a time t, the two candles will have the remaining length: L-Lt/2.5 (faster) and L-Lt/2.5 (slower).
So, if we compare their lengths after time t we get:
(L-Lt/2.5)/(L-Lt/5)=4/7 the ratio of faster:slower. The candle length L cancels out: (1-t/2.5)/(1-t/5)=4/7.
Cross-multiply:
7(1-t/2.5)=4(1-t/5),
7-7t/2.5=4-4t/5,
3=7t/2.5-4t/5=14t/5-4t/5,
3=10t/5=2t, t=3/2=1.5hr.