Suppose we toss a ball 2 meters up and it returns to the hand in .9 seconds, if we do the same in a moving train(constant speed), will it return at the same duration? .9 seconds? Is there an equation to prove this?
Under ideal (non-realistic) conditions, yes, the vertical motion is independent of any simultaneous horizontal motion. This is called the superposition principle and it applies to all geometric/Euclidian vectors, also i.e. forces, momenta, impulses and the like. It can be verified in experiments.
This principle lays for basis for the mathematical idea of splitting physical vector quantities into their components and then treating those components separately after which you can add up or collect the results into a resulting vector.
Realistically, air drag and other factors might cause the duration of your throw to not stay the same in both scenarios if it was real life. The superposition principle still holds true, but many factors that are not easy to control and prevent will influence the fall. Air drag varies with the speed (velocity magnitude) of the ball, and the speed in a simple vertical throw is smaller than in an angled throw, which would be the case with an initial sideways motion.
When this type of question is posed, it is usually implied the train is enclosed, thus there is no external aerodynamic forces acting horizontally on the ball.
From a typical "high school physics class" perspective, the ball returns precisely to hand because that illustration is trying to prove a point about vectors and energy conservation... But excludes tiny factors that are beyond the scope of the illustration, which is only meant as a building block for later concepts. But at the engineering level, you have Coriolis and Eötvös effects that need to be considered. Coriolis says that the ball actually lands in your hand thousandths of an inch closer to the rear of the train than the front. And Eötvös says that the moving train ball will still land in your hand, but thousandths of a second earlier or later than the stationary throw.