Adult elephants are vastly bigger and stronger than any crocodiles in its natural environment. As such, an adult elephant will simply pull the crocodile out of the water swing them about, then mud-stomp the crocodile into a bloody mushy puddle.
Baby elephants are far more vulnerable and are much easier prey. This stated, there’s always an adult elephant nearby. And the crocodile risks getting attacked by the Mama elephant. But, if Mama is too far away, the crocodile if big enough more likely than not succeeds in killing the baby elephant.