Noise hangs i2c and Arduino

I'm using an IMU to control the direction of a robot(brush dc motors from dfrobot, so not very good). It's connected via an i2c bus. When there's no motors the reads are fine, but when the motors are running it affects the scl and sda lines and the arduino freezes.
I suppressed the radiated noise by soldering ceramic decoupling capacitors to the motors (reading the IMU with a different arduino than the one controlling the motors work), but conducted noise makes it fail with only one arduino.

I have tried:
Pulling up sda and scl lines with 2.2 and 4.7 kOhm (it lasts longer but freezes anyway)
Plug the imu directly to the board instead of having it connected with cables (same result)

I've thought of using an optoisolator but I guess in this case it will have no effect since the noise on the board will affect the cables anyway.

Any ideas?

Keep all connections between Arduino and IMU as short as possible; no more than a few centimetres. Avoid wires to motors being close to those connections.

Consider putting an inductor in series with each motor. Then put ceramic decoupling capacitors to earth on both sides of each inductor.

There may be other issues with the routing of your circuit interconnections, especially ground connections. It may help if you provide a photo of your circuit.

Would I be correct I guessing your Arduino and IMU are both powered by 3.3 volts derived from a battery?

If all else fails, instead of using the 'Wire' library consider using this I²C library where you can set a time-out in case of freezing / lock-up.