Most VFDs provide DC bus terminals. Even on those that don't, I've just put DC on two of the AC terminals and let it pass straight through the diodes. The only issue with that is that the diodes might not be sized to have all of the current pass through one diode per pole, so the VFD need de-rating. Many small VFDs 3HP and under are already sized to be capable of single phase AC input without de-rating, but that will put current through 4 or the 6 diodes, you would only have two. That's going to make a 3 phase rated drive need to be LARGER than 3HP, which then means you lose the no de-rate issue. So that leaves you with finding a VFD with DC bus terminals on it. They are out there, my employer makes them, specifically for this purpose.
So that just means getting the right voltage on the terminals, plus figuring out how much power you need to store, i.e. how many operations do you need to hold up for? Voltage wise, I'd go for finding a 200V rated motor, which will require that you get the DC bus voltage up to 280VDC or so, which boils down to 24 x 12V batteries in series. The drive we make will continue to operate down to 190VDC, which will become about 135VAC. What that means is that down to that level, the drive will have to limit itself to about 40Hz, so as the voltage drops, your gate may have to move slower, you need to work out those details. but once you know those limits, and what is expected of the backup system, you can then size the batteries.
When all of that is done, you will need a float charger for the batteries, the VFD will not do that for you.
Good luck.
"You measure the size of the accomplishment by the obstacles you had to overcome to reach your goals" -- Booker T. Washington