The scientific literature says that every drain is a different ecosystem and that the species makeup of the microbial community within depends on many factors. They have a multitude of suggestions.
The material that the drain is made from is important, but it remains uncertain if any material is better or worse. I personally think stainless steel would be best, but PVC is not a bad material or anything.
Biofilms will develop resistance to chlorine and quaternary ammonium cations (quats) over time. This resistance is not an evolved resistance; the members of biofilm use all kinds of extracellular excretions to protect themselves. This means that after a cleaning down to the bare metal or plastic pipe, the survivors will not be able to instantly recover the properties of the biofilm from their genetics. The individuals in the biofilm are not adapted to chlorine and quats or anything else.
My take on biolfilm resistance is that they will eventually develop resistance to any sanitizer or combination of sanitizers. One must include a mechanical cleaning component such as scouring or ultrasound. Unfortunately, mechanical scrubbing has a tendency to produce an aerosol of live bacteria which will float up and away and settle all over the place.
Ultrasonic cleaning with a hot potassium hydroxide-based detergent solution is mentioned as successful in knocking back biofilms by 4 logs in 60 seconds.
As people above mention, a continuous drip of chlorinated water works sometimes, peracetic acid works sometimes, and hydrogen peroxide works sometimes.
On the more experimental track, competitive exclusion with non-pathogenic species has been found to work. Soaking biofilms with Lactococcus lactis and Enterococcus durans has been shown to wipe out Listeria monocytogenes.
Interestingly, the ambient humidity in the air in the drain plays an outsized role in keeping biofilms alive. So if a drain is rarely used, one could cut off humidity to the biofilm above the waterline by pouring in a layer of mineral oil. This also prevents sewer gases and odors from exiting the drain, and, who knows, might even keep the bacteria from aerosolizing and exiting the drain too.