One advantage of a motor-generator set is that it's relatively easy to get high-voltage isolation using an insulating shaft. It might be possible to build something that could survive nearby lightning strikes to the incoming AC line. I don't think any standard UPS can do this.