Two cars in different directions

Two cars drive on a straight highway, at time t= 0, car 1 passes mile marker 0 traveling due east with a speed of 20 m/s. At the same time, car 2 is 1 km east of mile marker 0 traveling at 30 m/s due west. Car 1 is speeding up with an acceleration of magnitude 2.5 m/s^2, and car 2 is slowing down with an acceleration of magnitude 3.2 m/s^2. (a) Write x versus t equations of motion for both cars, taking east as the positive direction. (b) Also, at what time do the cars pass next to one another?

The 24 second mark isn't necessarily the "better" time, it's just the first time that the cars pass. Since Car B is accelerating faster than Car A, it will eventually (in 118 seconds) pass Car A again. Both of the times are correct.