Probably a spark ignited built-up hydrogen gas from charging. It's not uncommon. It's a good idea to open any compartments while batteries are charging, especially for the first 8 or 10 hours. Loose connections or a mechanical failure inside the battery can supply the spark.

The one battery failing wouldn't have caused the others to fail, but it could have tripped a breaker or damaged the wiring. Measure your voltage across the posts that have the TM cables connected. You should see about 38V if the charger has been off for a while, up to a little over 44V with the charger on.