From the train station – the point S – originante two tracks, i.e. rays, which do not lie on a common straight line. Along these move two trains, which are line segments. On the first track a train is moving toward the station S, while on the other track the second train leaves from the station. We shall consider the motion of train-segments only for such period of time during which they are leaving the track-rays.
At any fixed time consider a convex quadrilateral whose vertices are the endpoints of the train-segments. In particular, consider the point where its diagonals intersect.
Find out the necessary and sufficient conditions for all these points of intersection to lie on some parabola.

The whole setup is invariant under affine transformations. Therefore you can (without loss of generality) assume a coordinate system where the incoming train rides on the positive $x$ axis and the outgoing on the positive $y$ axis, and both travel with unit speed. So you'd have the heads of the trains at $(x_1-t,0)$ and $(0,y_1+t)$ and the tails at $(x_2-t,0)$ and $(0,y_2+t)$. Then the point of intersection is
$$ P(t)= \frac1{(x_2y_1-x_1y_2)-t(x_1-x_2+y_1-y_2)} \begin{pmatrix} (t-x_1)(t-x_2)(y_1-y_2) \\ (t+y_1)(t+y_2)(x_2-x_1) \end{pmatrix} $$
So this is a rational curve of degree $2$ in $t$. If you compute its implicit form, you will find that it is indeed a conic section. So you want to know when this conic section will be a parabola. For that you care for the limit cases, $\lVert P\rVert\to\infty$. There are two ways how this could happen: either the denominator of the scalar coefficient becomes zero, or you have $t\to\infty$.
\begin{align} t&\to\frac{x_2y_1-x_1y_2}{x_1-x_2+y_1-y_2} & t &\to\infty \\ P(t)&\to\lambda\begin{pmatrix}x_1-x_2\\y_2-y_1\end{pmatrix} & P(t)&\to\mu\begin{pmatrix}y_1-y_2\\x_2-x_1\end{pmatrix} \end{align}
Your curve is a parabola if and only if these two directions agree, i.e. if these two vectors are linearily dependent.
$$ \begin{vmatrix} x_1-x_2 & y_1-y_2 \\ y_2-y_1 & x_2-x_1 \end{vmatrix} = (y_1-y_2)^2 - (x_1-x_2)^2 = 0 $$
which is simply asking that both trains have the same length – in this coordinate system. Taking our special choice of coordinate system into account, this means that the ratio between length and speed must be the same for both trains:
$$\frac{\ell_1}{v_1} = \frac{\ell_2}{v_2} $$