Medium-pressure energy storage for hydrogen production