Imagine we have a train which is moving with a velocity and there's an observer inside of that train and there is an observer that is outside of the train observing the train moving. There's a ball inside of that train which is at a height. Now the ball is also moving with a constant velocity downwards. Observer which is inside of that train will observe this event as motion of the ball the downward direction and the observer which is outside of the train will observe the event of falling of ball as the motion in the diagonal direction.
My question is, are these equations correct to measure the time it will take for this event to occur in both frames. If so, why do I get different results by putting different values. Because i should always get less time in the train (according to special relativity). Right? Sometimes the observer outside observes less time than the one inside and sometimes the opposite.
Note: I had to paste the image, because I don't know how to draw diagrams and write equations here.