Here's an experiment:
Prepare one two liter bottle with a recipe that produces a certain amount of CO2 for a week.
Prepare another two liter bottle the same as the first, but with 1/2 the amount of yeast.
Yeast cells can double in just a few hours. So theoretically, the second bottle should lag only a few hours behind the first. And in the long run, both should produce the same amount of CO2, and for about the same time.
But it does not. The second bottle produces about 1/2 the CO2, for about 2x the time. Why?
Yeast needs nutrients just like plants do. There's hardly any nutrients in sugar, only empty calories as mom used to say.
The only real nutrients in the bottle were added with the yeast itself. Once those nutrients are gone, they are not available again until old yeast cells die and release them. The yeast population reaches a fixed plateau.
Now when making wine or beer, there's a lot more stuff in there than sugar, and lots of nutrients to go around. Brewers sometimes add "yeast nutrient" too, just to make sure that nutrients do not become a limiting factor.
So yes, I suppose you could use a 5g jug to produce CO2 at a fairly constant rate for months at a time.
But figuring out the right recipe might be difficult.
And there might be other factors too. For example, another less-desirable bacteria might manage to muscle in on your malnourished yeast...