Why does tossing a coin in a train and on a train differ?
In an ideal situation (no air resistance) there will be absolutely no difference in the place where the coin lands! Whether you toss the coin up from inside the train or while standing on the roof, the coin will land back in your hand (provided you've tossed it perfectly vertically).
However, in practice, while standing on a fairly fast train's roof, there's a lot of wind because you're moving at high speed. The moment you toss the coin, the wind force acts on it, and creates an acceleration in the backward direction, making it go slower than the train (and you).
However, it won't land in exactly the same place from where you tossed it every time! This purely depends on the retarding force acting on the coin - in this case, the wind.
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."
and:
"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).
In general, it won't drop to the place right above where you dropped it in the roof-of-the-train case, but its motion will be different.
The situation is different in that generally there are other forces on the coin: the air is moving relative to the coin not only vertically, but also along the direction of the train's motion. In other words, when on the roof, the wind blows on the coin.