Heating and acceleration of charged particles during magnetic dipolarizations