There are several long-winded answers to this, but it's worth noting your observation isn't necessarily correct.
Firstly, if you throw a ball it slows down the moment it leaves your hand - the accelerating force is no longer applied to it, so the remaining laws of physics are left to their own devices causing the ball to change direction and apparent speed: Gravity will cause a change in it's direction, the air the ball is moving in will cause drag which makes it slow down (I will ignore gradients and wind speed for the moment).
It's key to observe there are 2 relative speeds and 1 absolute speed. The absolute speed is a stationary object, which effectively has a zero-energy state. There is no energy in it to be transferred to another form (such as movement in a direction), therefore no potential energy - everything in the universe moves to a zero energy state, bleeding off it's energy as movement, light or heat. In the example of the train, the 2 relative speeds are the speed outside the train and the speed of the train itself. For the sake of argument, the train is travelling at 30mph in a northerly direction relative to the speed of the planet's surface, which we will say is 0mph.
The contents of the train are also moving at 30mph, which includes the air in the carriage (in my experience of trains, this is always stale - a fact that has no relevance in this case). So if you threw the ball in the direction of the train's movement at let's say 6mph, the speed of the ball would be 36mph. The ball will start slowing down almost immediately (wind resistence and friction with objects in the carriage - i.e. bouncing) to the point it comes to a rest. Assuming it doesn't leave the carriage, it will still have the force of the train applied to it, so it's speed is 30mph. Relative to the contents of the carriage, though, this is 0mph. If it left the carriage, it's speed would be 0mph relative to the planet's surface, or 30mph in the other direction relative to the train.
What if you turned round and threw the ball in the opposite direction at 6mph? The moment it leaves your hand it is travelling at 24mph relative to the planet's surface. However, because all the forces (with the exception of gravity) applying to it are within the carriage it will start to speed up relative to the planet's surface from the moment it leaves your hand. Relative to the carriage contents it will slow down, though. So it's resting speed relative to the planet's surface is 30mph - higher than when you threw it.
Hope that helps - it may have a faint aroma of bovine turds, but that's the simplest I can make it other than saying "because it just does".
Interestingly, the same thing doesn't happen with regards to light, which remains unaffected by things like wind resistence and is only subject to a change in direction courtesy of gravity. So if you shone a torch on the train in the direction of it's movement, the speed of the light photons/waveforms won't be the speed of light + 30mph, it will always be the speed of light (Universal speed limit, as defined by Einstein).