Whales/dolphins being mammals can in fact survive on land for a while, it's when they're beached and can't eventually get back into the ocean that problems arise.