Golf cart batteries produce hydrogen gas that is susceptible to igniting if a spark occurs.
Degraded, corroded golf cart battery cables can arc and ignite hydrogen gas that hovers around batteries.
Replace battery cables that are corroded. Golf cart battery cables are only $5 ea and less expensive than replacing a golf cart battery.
To prevent or slow corrosion, use battery terminal protection spray on all metal parts under the golf cart seat.
Vaseline will also work to slow battery corrosion.