I'm assuming the two cars start from the same point!
Let's measure time t from the time when Car 2 starts.
Then the distances travelled by the cars up to the time of overtaking, t, must be the same.
And we need to measure all time in hours, so 18 mins. is 0.3 hours.
So, 45 x (0.3 + t) = 65 x t, so 20t = 13.5, so t = 13.5/20 = 27/40 = 40.5/60, i.e. 40 min 30 sec