I don't think that 4m has anything to do with the problem.
anyway. here.
A___________________B_______C
where A is the point that the train was released.
B is where the wheel started to stick
C is where it stopped
From A to B, v=2.5m/s, it takes 2s to go A to B so t=2
AB= v*t = 2.5 * 2 = 5m
The train comes to a stop 7.7 m from the point at which it was released so AC=7.7m
then BC= AC-AB = 7.7-5 = 2.7m
now consider BC
v^2=u^2+2as
where u is initial speed, in this case is 2.5m/s
v is final speed, train stop at C so final speed=0, so v=0
a is acceleration
s is displacement, which is BC=2.7m
substitute all the number into equation, we have
0^2 = 2.5^2 + 2*a*2.7
0 = 6.25 + 5.4a
a = -6.25/5.4 = -1.157
so acceleration is -1.157m/(s^2)
The ball can't reach the speed of 20 m/s in two seconds, unless you THROW it down from the window with a little bit of initial speed. If you just drop it, then the highest speed it can have after two seconds is 19.6 m/s .
If an object starts from rest and its speed after 2 seconds is 20 m/s, then its acceleration is 20/2 = 10 m/s^2 .
(Gravity on Earth is only 9.8 m/s^2.)
The term you need to know is equilibrium. Technically it means that heat gained = heat lost. Normally in beginning chemistry classes the evidence for this condition is a stable temperature.
Solution :
The motion in the y direction.
The time taken by the toy rocket to hit the ground,

S = distance travelled = 30 m
u = 0 m/s
a = 
t= time in seconds
Therefore, 
t = 2.47 sec
Now motion in the x direction,
u = 12 m/sec

Upon integration 'v' with respect to 't'

Once again integrating with respect to t,


= 0.0176+29.64
= 29.65 m
Therefore, the toy rocket will hit the ground at 29.65 m from the building.