My opinion.
ANA battery:
One battery entered thermal runaway, causing heat damage to the others.
causes:
A single defective/mishandled/damaged cell.
Bad battery charger/BMS
JAL battery:
Most of the battery was overcharged. One cell finally let go and shorted. Firemen put out the fire before too much heat damage to adjacent cells.
causes:
Bad battery charger/BMS
Aircraft electrical system noise/interferance/bonding caused overcharging.
The only common denominator is the battery charger/BMS. The two batteries, to me, look like they had two completely separate failure modes.