The battery sensor is an electronic device inserted between the battery earth terminal and the earthing cable. It is encapsulated, so if corrosion hasn't broken the case it probably only needs the external metal tags to be cleaned.
Details are at https://www.bosch-mobility-solutions.com/en/solutions/sensors/electronic-battery-sensor/
Can I just remove the terminal with the battery sensor, clean it (do I recall that you use vinegar?) and re-install it without upsetting the vehicles electronics?? A bit more complicated than the Triumph Herald I had in the '60s.See the link I posted for details of what it does. It is for the computer's benefit. It is a terminal fitting to the earth cable. Since it is sealed inside its case and has no acid it isn't causing the corrosion.