Electrostatic ion acceleration across a diverging magnetic field