Do both cars leave the starting line at the same time ? That's kind of important. I'll assume that they both start out at the same time, and now I'll proceed to answer the question that I have invented.
-- Car B moves 4 m/s faster than Car A .
-- So Car-A's lead shrinks by 4 meters every second after they start.
-- It takes (10/4) = 2.5 seconds for Car-A's lead to shrink to zero.
-- So Car-B overtakes Car-A 2.5 seconds after they start.