It doesn't have to be cost competitive because it offers additional function. Mechanical storage (and generation) provide frequency regulation as well.
Batteries do frequency regulation, and respond within ~200ms of an anomaly, faster than any mechanical inertia or spinning generation can. If they’re at cost parity or cheaper than the flywheel, why flywheel?