I2C bus stopped working when power was switched to battery
Does the I2C work when you restart it again without the charger?
If so, the problem is likely that disconnecting the charger causes a di/dt which couples into your I2C lines.
Measure your I2C with a scope and check what happens when connecting or disconnecting the charger.

EDIT:
10k\$\Omega\$ is quite high and makes the I2C signals sensitive to more than only a charger being (dis)connected. I would lower them anyway to, like, 1 kOhm.