Could it work? Pressure in 2 containers isn't equal cause on the top the elastic acts on less surface of pistons with the same force respect lower...
Even if there is an imbalance of forces initially, all that will happen is the pistons will move until the pressure is equal on both cylinders, at which point movement stops.
You then have to reset the pistons to the initial position. That will take the same of energy (or more due to losses) as was released by the initial movement.