If I accidentally leave some pliers or my socket set out in the rain, I soak them with WD-40, scrub off the rust with a wire brush, and wipe off the excess with a towel. It does a decent job of preventing further damage. If I have some rusty parts sometimes I'll throw them in a glass jar, soak 'em with WD-40, shake them around, let them sit for a day or so, and then scrub them with a wire brush. Gets most of the rust off.
If you want a lubricant, just buy the correct one for the job. Silicone oil, lithium grease, graphite, all will do a better job in the long run than WD-40 if you use them in their intended role. My goto "universal lube" personally is "Super Lube", a PTFE-based lubricant which is NSF rated for incidental contact with food and dielectric.