What are you talking about? Batteries don’t dump their energy in seconds. They dump their energy over many, many hours.
The initial burst of flames you see in some videos is not the energy stored in the battery, it’s the flammable electrolytes separating the anode and cathode that’s burning.
There’s a study from Sweden that set an ICE and EV car on fire. The energy release profile is fairly similar. The ICE is a bit more intense overall. So there’s nothing inherently more dangerous about batteries. Quite the opposite.
The only issue with (current gen li-ion) batteries is the thermal runaway. When the battery is shorted the energy is dumped over the following hours and it’s nearly impossible to stop. It’s doesn’t “burn” per se, but it will get so hot that it will re-ignite any flammable material that the car or truck is made out of. For a trained fire department it’s fairly easy to deal with though. You just need to cool the battery pack during the time where it’s dumping its energy. This could be done with a specialised hose that sprays water underneath the battery pack. You can inflate a barrier around the car and fill that with water. We’ve also seen that fire departments get an empty container delivered, fill it with a bit of water and lift the car into it. For a truck that’s obviously not possible. My point is there’s dozens of ways to deal with it.
Several next generation batteries (which are fairly mature and well beyond the lab stage at this point) have electrolytes that are less flammable or not flammable at all. So you avoid both the initial burst of flames and reduce the potential of thermal runaway. With good separation between cells/packs, it’s extremely unlikely that the whole pack will burn at once.
EV cars and trucks are already objectively (as measured by fire statistics in countries with high share of EVs like Norway) safer. No company is going to introduce a battery chemistry unless it’s more safe than the current commercial cells, so it’s only going to get better from here. Fire departments are only going to be better trained, and these days they can just copy the learnings from countries like Norway, where the fire departments already consider EVs to be far better for overall fire safety than ICE vehicles.
Batteries have the potential to be nearly entirely fire proof, even while storing a lot of energy, so the future is very bright in this area.