That's a great question, and it's something city planners and manufacturers think about a lot. Modern urban trash cans, especially the newer smart or solar-compacting models, are designed with weather in mind. For heavy rainfall, the key features are usually in the lid and the body design.
Many public bins now have lids with built-in drainage channels or slight slopes. This allows rainwater to run off the lid instead of pooling on top. It's a simple but effective design. The lids themselves are often made from durable, waterproof materials like coated metal or heavy-duty plastic to prevent rust and water ingress.
More importantly, the main body of the bin is typically sealed at the seams to be waterproof. The drainage happens at the bottom. You'll notice most fixed street bins have small holes or a grated opening at their base. This lets any water that does get inside (from thrown-away liquid or driven rain) drain out slowly, preventing the bin from becoming a stagnant, smelly water container. This also helps keep the trash bags inside from sitting in a puddle.
So, in short, yes, the lids are designed to drain well, and the overall system is built to handle rain. The goal is to prevent overflow, minimize mess, and control odor, even during a downpour. It's a small but crucial part of keeping cities functional and clean in all weather conditions.