Answer
The final distance between the two trains is $40m$.
Work Step by Step
Step-1: Let us calculate the acceleration of the first train from the graph. The slope of velocity-time graph is equal to acceleration. Therefore, the acceleration of the first train: $$a_1=\frac{rise}{run}=\frac{0-40}{5-0}=-8ms^{-2}$$
Step-2: From the relation, $$v^2=v_0^2+2ax$$
We substitute values to obtain: $$(0)^2=(40)^2+2\times (-8) \times x_1$$ $$\implies x_1=100m$$
So, the first train stops after covering $100m$, from the starting point.
Step-3: Similarly, for the other train, acceleration is$$a_2=\frac{0-(-30)}{4-0}=7.5ms^{-2}$$
Here, $v_0=-30ms^{-1}$. This is because, each unit on the velocity-axis is $10ms^{-1}$. Here, we will use the same relation (as used in Step-2),
$$(0)^2=(-30)^2+2\times 7.5\times x_2$$$$\implies x_2=-60m$$Here, the negative sign implies that the train moved towards direction of the other train.
Step-4: Finally, the separation between the two trains is $200 - (100 + 60) = 40m$.