what's a chain?
Been on a belt for the last two years (2000km/year) of commuting on my strida and totally ignored chain maintenance besides a quick hose off after a rain ride to get rid of some dirt and letting it sit dry. switching to a belt drive was a very different feeling for daily commuting I found.
but to answer the op's question, Yes lubricant does prevent chain rust since you are coating the entire chain in a layer of oil. that itself acts like a shield against oxygen which then prevent oxidization (rust). Most of the rusty chains you see on the streets are with dry chains and nothing else on it. My mtn bike has a oily chain on it and I don't let it dry out, doing that it never rusted on me at all. Only thing with my mtn bike is that I gotta clean and re-oil after every ride but that's what you get for riding in dusty conditions. And after rain you should wipe off the chain of all water and then re-oil again. Doing that would push out any remaining bits of water in your chain links since oil is hydrophobic.