Either would work fine. Kegs are nice for storage since there is no light exposure, and no oxidation taking place if you properly purge the headspace with CO2 and set the seals.
Carboys can store beer very well also (especially the glass ones), as long as you minimize exposure by filling towards the tapered neck. You do need to make sure the airlocks do not dry out, but you only need to check on them once per month. Put them in a dark place, or wrap a towel around them to minimize exposure to light.
I would say both can store beer for up to a year with no problems if you follow the tips above. I have an RIS that I plan to age in a carboy for 5-6 months minimum.
Primary #1: Ice Shanty Bock #2: Empty
Secondary #1: Berry Rhubarb Wine #2: Black Currant Wine #3: Empty
Kegged: Hidden Lake Nut Brown, Border Crossing Vienna
Bottles: 2H IPA III, Carmel Apple Cider, Spruced Winter Warmer, Surly Bender clone, Big 50 Barleywine, Framboise Lambic, Dark Belgian Strong, Russian Imperial Stout, Sparkling Elderflower Wine, Barolo Wine, On Deck: ??