Energization of positive ions in the cometary foreshock region