Answer
For $a_B = -2.5ms^{-2}$, the cars are side-by-side for only $1$ time at $t=4.0s$. At $t=4.0s$, $x=28m$.
Work Step by Step
Step-1: Look at the graph; the blue line represents the motion of car $A$ and the green line represents the motion of car $B$.
Step-2: The equation for the movement of car $A$ can be easily derived by studying the slope and the intercept from the figure given in the question. Slope is equal to: $$m=\frac{rise}{run}=\frac{32-20}{6-0}=2m/s$$The intercept is $20m$. Thus, the equation for car $A$ is,
$$x=2t+20$$
Step-3: The equation for the movement of car $B$ can be derived after knowing that $a_B=-2.5 ms^{-2}$. The equation is,
$$x=ut+\frac{1}{2}\times a_B \times t^2$$$$x=12t-\frac{1}{2}\times 2.5 \times t^2=12t-1.25t^2$$
Step-4: Solving both the equations will give us a value or values of $t$ for which both of the cars are side-by-side. Therefore,
$$12t-1.25t^2=2t+20$$$$1.25t^2-10t+20=0$$
We solve the equation above using the quadratic equation:
$$t=\frac{-(-10)\pm \sqrt{(-10)^2-4\times 1.25 \times 20}}{2 \times 1.25}$$$$=\frac{10}{2.5}=4s$$
Therefore, cars are side-by-side for only $1$ value of $t$.
Step-4: (optional) An alternative method is to sketch the graph of the equation of both the cars and find the point or points of intersection.