Problem using Time dilatation formula We nave 2 trains with $V_1=3/5$ and $V_2=4/5$ with respect to a man at rest in the frame A (velocities are given in units of $c$). At time $t=0$ we have the back of the train 1, the forward of the train 2 and the man all in the origin. Both train 1 and train 2 have proper length equal to $L$.
I want to find how much time does it takes train 2 for overtake train 1 in A's frame. 
Well, I can simply use length-contraction formula and I find $$T=L \left(\sqrt{1-16/25}+\sqrt{1-9/25}\right)/(1/5)=7L/c$$
Then, I tried to work in the frame of train 1 (which I 'll call B), thinking that if I find the time of overtake in this frame, then I can find the time in A's frame using time dilatation formula.
So, first of all I find the velocity of train 2 in B, which is given by velocity addition formula $$V=(4/5-3/5)/(1-(4/5)(3/5))=5/13$$ 
Then the time of overtaking is $$T=L \left(1+\sqrt{1-25/169}\right)/(5/13)=5L/c$$
Finally using time dilatation formula, I find $$T_A=T_B/\sqrt{1-9/25}=25L/4c$$, which is different from the result I found before.
Where is the error in this procedure?What should I have done in order to achieve the right answer?  Thanks.
 A: Pay attention, two evevent that are simultaneous in one frame are no longer simultaneous in another one!

The calculations you did in the A frame are correct, I just whant to stress the fact that the time you got is not an absolute time, it is a time interval respect to the origin $t = 0$ i.e. $(t-0) = 7L$.
Now let's move to the frame B (a variable with prime index '  is a variable in B frame). In this frame we have the train 1 at rest and the train 2 moving with speed (I write everything in unit of c)
 $$v'_2 = \frac{v_2-v_1}{1-v_2v_1}=\frac{5}{13}$$
now let's call $x_1$ the forward of the train 1 and $x_2$ the back of the train 2. At time $t =0$ in A they are respectively $x_1 = \frac{L}{\gamma_1}$ $x_2 = - \frac{L}{\gamma_2}$ where 
$$ \gamma_1 = \frac{1}{\sqrt{1-v_1^2}} = \frac{5}{4}\ \ \ \ \ \ \ \ \ \ \gamma_2 = \frac{1}{\sqrt{1-v_2^2}} = \frac{5}{3} $$
Now let's perform a Lorentz transformation (boost with speed $v_1$ in the positive x direction) in order to go in frame B, the event $t = 0 \ x_1 = \frac{L}{\gamma_1} $ the becomes 
$$t'_0 = \gamma_1(0-v_1x_1) = -\frac{3}{5}L \ \ \ \ \ \ \ \ x'_1 = \gamma_1(x_1-v_1*(0)) = L $$
this $t'_0$ is now our new "origin" in the sense the we will compute time interval of the form $(t'-t'_0)$.
Now we perform the same Lorentz transformation on the event $t = 0 \ \ x_2 = -\frac{L}{\gamma_2}$ that becomes 
$$t'_2 = \gamma_1(0-v_1x_2) = +\frac{\gamma_1}{\gamma_2}v_1L = \frac{9}{20}L \ \ \ \ \ \ \ \ x'_2 = \gamma_1(x_2-v_1*(0)) = -\frac{\gamma_1}{\gamma_2}L = -\frac{3}{4}L$$
That is another different time again. Now I can write the trajectory of the back of train 2 in B frame that is 
$$x'_2(t') = x'_2(t'_2) + v'_2(t'-t'_2)$$
The train 2 will overtake the train 1 when $x'_2(t') = x'_1(t') = L $ because the forward of the train 1 is at rest in the point $x'_1 = L$ in B frame; therefore
$$x'_2(t'_2) + v'_2(t'-t'_2) = L \Rightarrow (t'-t'_2) = \frac{91}{20}L $$
Now we remember that the "origin" of time in B sistem is $t'_1$ therefore the time interval we are looking for is 
$$(t'-t'_1) = (t'-t'_2) + t'_2 - t'_1 =\Big[\frac{91}{20}+\frac{9}{20}+\frac{3}{4}\Big]L =  \frac{28}{5}L$$
In order to find now the time interval $t -0$ in the frame A (that we have already found at the very beginning) we perform the $\color{red}{inverse}$ Lorentz transformation 
$$t-0 = \gamma_1[(t'-t'_1) \color{red}+v_1(x'_1(t') - x'_1(t'_1))]$$
but since in B frame the train 1 is at rest we have $x'_1(t') = x'_1(t'_1) = L$ and eventually we get that 
$$t-0 = \gamma_1(t'-t'_1) = \frac{5}{4}\frac{28}{5}L = 7L$$
you can understand that you have to obtain that value $t'-t'_1 = \frac{28}{5}L$ from this easily calculation:
in frame A the train 1 is moving at speed $v_1 = \frac{3}{5}$ and in time $t-0 = 7L$ his forward travels from $x_1(0) = \frac{L}{\gamma_1} = \frac{4}{5}L$ to $x_1(t) = x_1(0) +v_1(t-0) = 5L $.
Now we can compute the equivalent time interval in the frame B performing a Lorentz transformation 
$$\Delta t' = \gamma_1[(t-0) - v_1(x_1(t)-x_1(0)] = \frac{28}{5}L$$ 
A: The error is the inappropriate use of time dilation formula in the last step. The only concept you missed was that the formula you used to find time interval between two events in $A$ is applicable if the events happen at the same place in $B$. The time to overtake is the time interval between two events that are not at the same place in $B$. Thus, to find the time interval between them in $A$, we should use the full Lorentz transformation formula, i.e., 
$t_A = \dfrac{t_B - vx_B}{\sqrt{1-v^2}}$
Considering your conceptually clean approach in the rest of the description, I am sure you will work out the details. 
