The factory where Fantine works has electric lights (the forewoman specifically says that if Fantine works late, the cost of electricity to keep the lights on will come out of her wages, making any overtime pay meaningless). That part of the story is set in 1820. Electricity was not introduced in France until 1881, and even then its spread was very slow, starting in major cities.