The way you have worded the question, with train one going backwards at 100 m/s and train two going forwards at 90 m/s the trains would never meet. No need for a calculation, they are going in opposite directions.
The trains stop well within the kilometres of separation between them so I would suspect a trick question.
Newton's first equation of motion: v = u + at
Second equation: s = ut + 1/2 at^2
Third: v^2 = u^2 + 2as
Using third equation to calculate distance to stop:
Train travelling at -100 m/s 0 = 10000 + 40 x s so s is - 250m
Train travelling at 90 m/s 0 = 8100 - 40 x s so s is 225 m
(Acceleration and deceleration are directional (vector quantities) so deceleration can have a negative sign as above).
If I were answering the question I would draw a quick graph showing the directions of travel and put in the quick calculation above to show that you have understood the maths and physics even if I had made a mistake taking down the question.