Let [tex]v[/tex] be the speed of train A, and let's set the origin in the initial position of train A. The equations of motion are
[tex]\begin{cases}s_A(t) = vt\\s_B(t) = -\dfrac{8}{7}vt+450\end{cases}[/tex]
where [tex]s_A,\ s_B[/tex] are the positions of trains A and B respectively, and t is the time in hours.
The two trains meet if and only if [tex]s_A=s_B[/tex], and we know that this happens after two hours, i.e. at [tex]t=2[/tex]
[tex]\begin{cases}s_A(2) = 2v\\s_B(2) = -\dfrac{16}{7}v+450\end{cases}\implies 2v = -\dfrac{16}{7}v+450[/tex]
Solving this equation for v we have
[tex]2v = -\dfrac{16}{7}v+450 \iff \dfrac{30}{7}v=450 \iff v=\dfrac{450\cdot 7}{30} = 105[/tex]
So, train A is travelling at 105 km/h. This implies that train B travels at
[tex]105\cdot \dfrac{8}{7} = 15\cdot 8=120 \text{ km/h}[/tex]