Are other drinks besides water still hydrating?

I frequently hear that beverages with caffeine or alcohol are not good for replenishing fluids and preventing dehydration. But in reality aren't they just a bit less effective at hydrating your body than other beverages? In other words, if you were stuck in the desert with nothing to drink but beer, coffee and cola, would you actually be worse off and die of thirst sooner if you drank these beverages versus not drinking anything at all?