Yes, if use an inverter. In this case, we have to switch the electronics switches such that the current injected in the grid is leading. I think that the battery in this case will keep discharging and charging each cycle with a net zero power in case of 90 degree leading current in the ideal conditions.
You can provide reactive power to the grid by grid connected inverter whose current is controlled to be in phase quadrature with the grid voltage. The reactive power is stored in the reactive elements in the grid, but is it withdrawn from the power stored in the battery. So, the battery stored energy will decrease by the amount delivered to the grid. In the times where you want to decrease the reactive power you convert the reactive power into into DC power and recharge the battery.
The grid connected (side) converter (GSC) is controlled according to the voltage oriented control (VOC) principle, which allows for independent control of active (d-axis current) and reactive power (q-axis current) flow between grid and GSC. Therefore, you can control the reactive power exchange between the Grid and theGSC by the q-axis current.
Since a battery is DC it only stores or releases real power the battery itself won't affect reactive power. However like any other DC source the connection to the AC system can be used to correct PF or provide reactive support.
The reactive power means that there is an ac component of current which delivers and restore power repetitively. This can be done by using electronic switches to control the flow of the current in a load.