The other answerers have failed to do their research correctly. NASA and China are both researching this. The idea is it helps increase the life of the battery on board since there are less charge cycles - but a battery is still used because by just using the flywheels for energy storage, the life of the flywheel bearings is reduced. Using both provides the longest lifetime for an unmanned satellite.
Well, the fly wheel to be used for power grid storage is efficient because it's lightweight; not heavy that the other answerers believe. To be fair to them, JET uses 2 775 ton fly wheels, which spin up to 225 rpm, but they were built 30 years ago, and getting slow heavy wheels is significantly easier than fast light ones.
Energy stored is linear with mass, but squared with velocity - so by having a lighter wheel of half the mass that can spin double the speed without tearing itself apart, double the energy is stored.
These fly wheels are suspended by magnets in a vacuum; and allowed to spin to huge velocities.
So in principle - putting them in space would actually make life much much easier for the vacuum side of the problem. The magnets to stop it hitting the ship aren't particularly light, but can clearly be scaled down for a ship rather than a city; And you could counter any imbalance of rotation forces by having 2 spin in opposite directions.
The problem is the amount of damage that can be done if things go wrong on a manned ship. If a battery goes wrong on a manned ship and you have a fire, you can implement emergency measures, seal the area with the batteries, and eject them. Granted not ideal, but it solves the problem. If something goes wrong with a flywheel spinning at 10k rpm, you won't have a space station to try and save; nor the time to try and save it.
The other issue is that (from the nasa interview) flywheels are good to store large amounts of energy, but not small amounts... Making them impractical for small craft.