Soda is sweet. Sugar keeps fermenting until there is no sugar, the yeast die (pressure, heat), or until the environment makes them dormant (High alcohol.)
Beer has no sugar left (kinda). It all ferments unless it hits one of those stops. (Like a 12% beer with residual sugar.)
You can force carb in 2 liter bottles with a carbonator cap, keg it all and fill bottles (but you really gotta clean the rootbeer smell out after), or keg carbonated water and have a rootbeer (and other) syrups to add to each glass.
Theoretically, this would be indefinately. But... You need good sanitation or preservatives. Alcohol preserves beer to an extent. Some chemicals preserve soda(acids, sodium benzoate). Otherwise something small can replicate, even at cold temperatures. (Ever have pasturized cider start fermenting on it's own?)
Many threads cover all these questions.
http://www.homebrewtalk.com/f95/corney-bottle-256965/
Keyboard is broken so can't give more right now. (using a mouse to type sucks.)