During a ram, you are supposed to stop moving the ship, resolve the ram, and then (if the ship survives...) finish moving the ship. Because the explosion was caused by the ram, the explosion would happen at the site of the ram, not where the ship finishes moving. This is the same idea as a ship exploding after going on All Ahead Full through an Asteroid Field. The ship explodes when it is in the field, not at the end of where its movement would have been.