@Nolan
Some of the EV cars have a "regeneration" (re-gen) mode whereby they can partially re-charge the battery while slowing down or braking. Some electric bicycles have that feature, too, but you'd need one helluva long downhill to fully recharge the battery, as the re-gen is only intended as a partial booster, not a full recharger.
There is also some drag introduced when the re-gen is turned on, kind of like dragging your brakes slightly whenever you stop pedaling. Several of my friends have E-Bikes and only one uses the re-gen feature - the rest don't like it all that much. I tried riding their bikes and I'm not a fan of it, either. It just feels weird.
Re-gen is intended to extend the battery charge life by taking advantage of gravity and/or the mass of the bike and rider, but using electricity to get up a hill and overcome gravity always takes more energy than overcoming gravity going down the other side.
For example, on one of my bike trips we started in Aspen, Colorado (8,000 feet elevation), up the mountain to the Maroon Bells at 12,000 feet. It took about 1-1/2 hours to climb up there. We rested a bit and then rode back down and that took about 15 minutes (it's about 11 miles distance). It would probably take a little longer coming down on an E-Bike because the re-gen would slow you a bit, plus riding a 45+ pound E-Bike is a lot heavier in turns than my 15 pound non-electric road bike.
On the idea of using a battery to run a generator to recharge another battery; Yes it would work, but as Danny alluded, there is a bit of loss incurred along the circuit: The generators isn't 100% efficient, meaning that it takes some juice to run the generator itself so you lose a little there each time. The first time you re-charge from one battery to another you probably won't get to 100% charge before you run out of juice on the battery running the generator, then you flip the other way to recharge the other battery and lose a little more and so on.
Will you extend the overall charge and 2-battery life? Yes.
Will it be a meaningful amount of extended charge, overall? Probably not.
I would expect that, if you kept the two original batteries as-is, removed the generator and filled that recovered space with more batteries, you would get as much, if not reasonably more, overall battery life (mileage, if in a car) than using the generator idea.
Is this kind-a clear? The big thing to consider is energy loss in the generator due to friction, heat and just plain inefficiency of the energy transfer (as Danny mentioned - I just used more words).