That's an excellent and practical question! From my experience observing city infrastructure and speaking with public works departments, the durability of urban trash cans against UV rays has improved dramatically, but it still varies significantly by material.
Most modern public bins are now made from UV-stabilized plastics like HDPE or polypropylene. These are formulated with additives that act as "sunscreen," absorbing and dissipating UV radiation before it breaks down the polymer chains. A high-quality, UV-resistant bin in a temperate climate can easily last 5-7 years without significant brittleness or fading. However, in intense sun regions like the desert Southwest or tropical areas, even the best plastics will show signs of degradation—color fading to a chalky white and increased surface brittleness—within 3-4 years of constant exposure.
Metal bins, typically coated steel or aluminum, don't degrade from UV directly, but their powder coatings can fade and chalk over time. The real weakness is that metal conducts heat, making them extremely hot to the touch and potentially accelerating liner degradation.
The biggest failure points are often the lids and moving parts, which endure the most stress. A common sight is a bin with a structurally okay body but a cracked, broken lid hinge.
So, to answer directly: they hold up reasonably well thanks to material science, but they are not immortal. Municipalities factor this UV degradation into their replacement cycles. For a homeowner buying an outdoor can, looking for a "UV-resistant" or "UV-stabilized" label is crucial for longevity. The investment pays off by avoiding a bin that cracks and becomes an eyesore after just a couple of seasons.