Let the start position to be like this:
from left to right, a train in station 1, 7,13,19
from right to left, a train in station 24,18,12,and 6
I am at station number 12, there is a train which will stay one minute then will move to the right.
as it moves,all the trains will move at the same time,like this:
from left to right,2,8,14,20
from right to left,23,17,11,5
after another movement:
3,9,15,21
22,16,10,4
and so on...after 4 minutes,the train that was at 7 will reach 12 from left side,the next train which was at 18 will reach 12 from the right side( after 5 min.).