Question 997244
You almost solved it, but not the way the problem specified.
With {{{t}}}= time in seconds from the moment car B passes car A
The distance from the point where car B passed car A is
{{{s[B]=25t}}} for car B (for {{{t>=0}}} , because we do not know what car B was doing before), and
{{{s[A]=(1/2)*2*(t-5)^2=(t-5)^2=t^2-10t+25}}} for car A for {{{t>=5}}} .
(Of course, for {{{0<=t,5}}} {{{s[A]=0}}} because car A was not moving then).
So when A is level with B again, {{{s[A]=s[B]}}} , and
{{{t^2-10t+25=25t}}}--->{{{t^2-10t+25-25t=0}}}--->{{{t^2-35t+25=0}}} .
The solutions to that equation, using the infamous quadratic formula are
{{{t=(-(-35) +- sqrt((-35)^2-4*1*25 ))/(2*1)=(35 +- sqrt(1225-100))/2=(35 +- sqrt(1125))/2}}} .
Since {{{(35 +- sqrt(1125))/2<5}}} , it is not a solution to our problem.
The solution to our problem is
{{{t=(35 + sqrt(1125))/2<5= about34.27}}}
(You had a little problem with {{{"+"}}} and {{{"-"}}} signs, but I make those mistakes sometimes, so that proves that we are both human). 


WHAT THE TEACHER WANTS (I think):
Here is how I would answer if it was my homework.
{{{t}}}= time in seconds from the moment car B passes car A.
{{{s[A]=(1/2)*2*(t-5)^2=(t-5)^2=t^2-10t+25}}} for {{{t>=5}}} is the distance traveled by car A since B passes it.
{{{s[B]=25t}}} (for {{{t>=0}}} is the distance traveled by car B after it passes car A.
So, for {{{t>=5}}} , the system of simultaneous equations that describes the situation in the problem is
{{{system(s=t^2-10t+25,s=25t)}}} .
I used Microsoft Excel to tabulate and plot as shown below:
{{{matrix(3,10,t,0,5,10,15,20,25,30,35,40,s(A),0,0,25,100,225,400,625,900,1225,s(B),0,125,250,375,500,625,750,875,1000)}}}  {{{drawing(300,300,-10,40,-150,1350,
graph(300,300,-10,40,-150,1350,-250,(x-5)^2.5/(x-5)^0.5),
green(line(0,0,5,0)),blue(line(0,0,40,1000)),
blue(circle(0,0,0.5)),blue(circle(5,125,0.5)),
blue(circle(10,250,0.5)),blue(circle(15,375,0.5)),
blue(circle(20,500,0.5)),blue(circle(25,625,0.5)),
blue(circle(30,750,0.5)),blue(circle(35,875,0.5)),
blue(circle(40,1000,0.5)),
green(circle(0,0,0.5)),green(circle(5,0,0.5)),
green(circle(10,25,0.5)),green(circle(15,100,0.5)),
green(circle(20,225,0.5)),green(circle(25,400,0.5)),
green(circle(30,625,0.5)),green(circle(35,900,0.5)),
green(circle(40,1225,0.5))
)}}}