It makes perfect sense to put the battery in the rear - nearer to the fuel tank.
Doubt there is any “kaboom” risk in mounting the battery in the rear boot of a vehicle separated from the petrol tank by metal panels
However, vehicle manufacturers are odd beasts …
A battery located in the boot, far away from the heat of the engine bay, is always an improvement as it helps extend the life of the battery. As such it’s a good move…
To counter the above logic, some (all?) vehicle manufacturers have moved the ECU from within a climate controlled cabin into the heat of the engine bay… just to save on a bit of wiring and make production 30 seconds quicker… But doing such can’t help ECU longevity...
There must be balance after all