But if you are limited on board space, you can try to connect a series resistor between the MCU pins and the capacitors. Resistor would limit the current when turning it on or off. This will slow down the power supply rise on the sensor side, make sure that sensor is ok with that.
If the resistor voltage drop is too high, you can use this trick if you have two MCU pins.
MCU-pin1: This pin is connected directly to the accelerometer's power rail. Set it as an input (tri-state it) but command it's output state as a high.
MCU-pin2: This pin is set as an output and is connected via a suitable resistor to the accelerometer's power rail. Set it low initially.
To activate the accelerometer's power rail, change MCU-pin2 to a high. Delay for a time to charge the capacitor, and then change MCU-pin1 to an output (Set to high already)
To deactivate the accelerometer's power rail, change MCU-pin1 back to an input and at the same time make MCU-pin2 low.