Mammals have lungs, so do marine mammals. Nevertheless some marine mammals seem to die rather quickly when they strand on a beach.
As they have lungs and can breath while on land, why do they die so quickly? Not being in water only restricts them from food.
Do they maybe try to get back into the water so rudely that they get hurt by rocks and/or break bones? Pressure difference doesn't seem to be a problem as they can jump out of the water as well.
I was wondering after reading this article on stranded pilot whales that got spot but died rather quickly after.
In the case of whales, I always thought that it was something to do with the fact that they rely upon buoyancy to support their weight and this seems to support that view:
When whales, including small whales or dolphins become stranded on beaches they suffer from the pressure of their own weight on their organs,in the water they are weightless. They also suffer from overheating as they have blubber that insulates them in the water and outside of the water causing them to overheat. This is why we place wet towels and cold water on their fins and flukes when do they strand to help keep their body temperature down. Unfortunately most stranded whales do not survive once they have beached themselves.