I do a lot of electrical work around vehicles and by far the best treatment for battery terminals is lanolin spray.
It’s good for any 12 volt electrical connections that are exposed to the elements, it can also be used as a lubricant metal and plastic hinges and other joints. Great stuff for stopping plastic joints from squeaking.
It will also stop rust occurring on exposed metal and where rusting has already begun, it will stop it going any further.
The best lanolin spray I’ve found is the stuff Briggs & Stratton market, you can get it from most lawn mower outlets.
The trick with lanolin is to spray it on and then let it dry for few days, it then gives a dry air tight seal on things like battery terminals.