This has been done in different forms - weight of the flywheel often undoes a lot of the benefit...however it works reasonably successfully as a hydraulic system (even as a retrofit - an Australian company www.permo-drive.com got a contract to fit their gadget US military trucks a few years back). Their system connects straight onto the drive shaft - massive compression of oil under braking or downhill, then released for acceleration.