Ok - I saw the graph - why are you surprised that the ratio is very high for hydro? Yes, building a dam is very energy-intensive, but afterwards what you have is basically free energy for decades.
And the dam is actually a very small part of the total mechanism. The bulk of the “energy collection” apparatus is the watershed that drains into the river you’re damming up. Essentially you have a gigantic machine that collects gravitational potential energy from rainwater, but you only have to build and maintain a tiny part of it.