The science described in the City of Ember is accurate. In the description of the generator, a modern hydroelectric device is described, capable of generating electricity. This generator has been in service for the last two hundred years and has supplied the energy needs of the sequestered underground City of Ember to this point.
The generator is powered by the force of the river, moving the wheel, which turns magnets within an electrical wire encasement. As is the case with most mechanical devices, the generator has seen better days and is now starting to experience some physical degeneration, resulting in power outages in certain parts of the city.
One would also think, however, if the builders of the City of Ember were smart enough to construct a massive electric power generator, they would also have been smart enough to realize it had a realistic longevity of service. Spare parts, skilled technicians, and even a standby generator would have been smart thinking for the future.