Light is only beneficial for inhibiting the growth of fungi if it contains ultraviolet (UV) wavelengths. The primary source of UV light among common light sources encountered most places is sunlight. Even then, if there's a "protective" UV filter screwed onto the front of the lens, it does very little to no good to leave the lens cap off, since the UV filter is as opaque to UV as the lens cap is to visible light.
In order for fungi to grow all three things need to be present:
- organic material (such as dust, which is mostly dead animal skin or dead plant matter)
- protection from UV light
If any one of those three is not present, fungi won't grow. There's dust in every lens, even before it leaves the factory. You'll never get rid of all dust unless you're working in a NASA grade clean room. But you don't need to. Preventing fungal growth only requires either a dry environment or periodic exposure to UV light. If a dry cabinet is doing its job there's not enough moisture to allow fungi to grow in your lenses and camera bodies.
So, what you think, should the lenses be stored in a dry cabinet with or without their caps?
Personally, I would leave the caps on when storing lenses. But then again, I use most of my lenses regularly enough that they are exposed to sunlight, and thus UV light, on a fairly regular basis. Most of my lenses are used in daylight conditions at least once per month. For the few that are not used regularly, I do make it a point to occasionally (once every six months or so?) get them out, place them near a window with the lens caps off and give them a few hours of exposure to sunlight.
I've not had any issues with fungi in any of my lenses over the past three decades or so, even though I live in a climate that can be fairly humid (the southeastern United States where the weather is highly influenced and affected by moisture coming from the Gulf of Mexico). I often use my cameras and lenses in very humid weather. This would include steamy summer days with humidity so thick you can almost cut it and fall evenings when the temperature falls below the dew point while shooting night field sports outdoors. In such cases I make sure not only my gear but also the bags and cases I carry and store them in are thoroughly dried out once I get home before putting everything away.