Once a Lithium battery gets going, it will only stop when it has been cooled or it has consumed itself.
Laptop fires in pax a/c are managed by water and isolation from neighboring combustibles, but that can't be done with something deep inside a pallet that might well take several minutes struggle to reach.
The real problem is propagation to adjacent batteries or ignition of adjacent combustible materials.
It should not be that hard, if not already done, to design a container for li-ion batteries that will contain a runaway, maybe with a cube of dry ice. If that can't be done, then shipping by air has to be a no-no.
If the pallet is sealed so that O2 can't get in, consumption of adjacent combustibles would be limited. But it would be necessary to allow venting for the climb to cabin altitude and subsequent descent. Perhaps a temperature sensor would prevent repressurisation on descent. Perhaps a CO2 container inside each pallet that released at high temperature would help.