I suspect your confusion is because you're holding two conflicting notions in your head, something like:
"Motion is relative, so physics works exactly the same inside a moving train car as inside a stationary one."
"Directions are absolute, so if I throw the coin straight up from the roof of the train, it goes the same way whether the train is moving or not. Either way, up is up."
The mistake, in this case, is in the second notion. Sure, directions are absolute, in the sense that (at least at non-relativistic velocities) you and your friend standing on the ground outside the train can both point your finger straight up and agree that you're both pointing the same way.
However, this doesn't mean that the coin lands in the same place regardless of whether you or your stationary friend throws it, because any additional velocity $\Delta v$ you impart to the coin when you throw it gets added to your own velocity $v_0$:
(Original train drawing by Wikimedia Commons user Emoscopes, used under the CC-By-SA 2.5 license. MS Paint cartoon by me, released to public domain per CC-Zero.)
Thus, even though you think you're throwing the coin straight up with respect to your own reference frame (since $v_0 = 0$ in your own frame — you're not moving relative to yourself), your friend standing next to the rails sees the coin leave your hand with a considerable amount of forward velocity in their reference frame.
In particular, if the train were moving in a vacuum (maybe it's a lunar train?), a coin thrown straight up would land at your feet, regardless of whether you were inside the train or standing on the roof (in a space suit, presumably). But by the time it landed, your feet would (from the perspective of someone standing on the ground) be far from where they were when you threw the coin.
Of course, on Earth, things are further complicated by air resistance. Assuming that the train is moving faster than the wind with respect to the ground, the apparent wind on the roof of the train will tend to push the coin backwards (and possibly slightly to the side), causing it to actually fall somewhere behind you (but probably still ahead of the point on the ground at which you threw it).