I'm just curious, do exercise machines for weight lifting and cycling have electric generators built in them to charge International Space Station batteries, or it's all going to waste?
All the electrical power requirements of the International Space Station are provided by its solar array wings and excess is stored in batteries (1) to be used when the station isn't exposed to direct sunlight, so there isn't any waste per se, the worst it could be said about it is that some of it isn't utilized.
And it wouldn't be all that much anyway, for example, a professional athlete could produce short, 6-second long cycling sprint bursts producing up to 1.2 kW (2) and minutes long sustained 120 W of electrical power, assuming there aren't any system losses and all of it could be utilized. In terms of ISS total electrical power consumption (solar arrays are capable of 120 kW of generating capacity (3) most of the time during one of its ~ 90 minutes long orbit), those few seconds of 1.2 kW or minutes of 120 W would be meaningless and all additional changes to its electrical system would needlessly complicate it for barely measurable benefits. Of course, ISS astronauts aren't professional cyclists, and their prolonged stay in microgravity environment further reduces their fitness, so consider those numbers highly exaggerated.
In reality, the second generation of exercise equipment used for daily exercise on board the ISS even consumes electrical power, either to provide resistance such as on the treadmill, or to run all the required electrical equipment that collects information on protocols and forces that are used as supplemental data for studies of muscle and bone loss and cardiovascular health during long-duration space flight (4).
Another way to look at it: It's VERY expensive to lift stuff to orbit.
What's going to produce more power, a pound of generator on a treadmill or a pound of solar cells? Which do you think NASA would lift if they want more power?