I guess I should have gone for a more elaborate answer. Which is to say that some of us disassemble our motors, use various waterproof coatings on magnets and stator, and drill drain holes in the side covers. This, plus occasional replacement of the bearings, is enough to keep the motors running long term in very wet and sloppy conditions.
For what it's worth, regular pedal bikes don't prosper when they're immersed, but with appropriate maintenance they can tolerate it up to a point, just like e-bikes.