Deterioration is caused by exposure of the guns to air and moisture. One way to insulate the guns from air and moisture is to drench them in Cosmoline. (This is good unless the Cosmoline is mechanically disturbed, and it's messy.) Another way is to put them in containers that can maintain a perfect vacuum.
There is (or was) an exhibit in the Springfield Armory Museum regarding a method that was experimentally tried in the 1950's. Aluminum canisters were devised that would each hold about a dozen M1 Garands, with their slings, bayonets, and other accessories, in a rack inside. The guns were left dry, with a desiccant powder. The canisters were hermetically sealed, and all the air was pumped out. After 20 years, some were opened, and the guns were in perfect condition.
Such a method is expensive, and it requires an industrial installation to carry out. As long as Garands were useful in a reserve capacity, it made sense. However, after many years, they became totally obsolete, and it no longer made sense to try to preserve thousands of them in this way. At that point, it was better to just release them as surplus to civilian shooters.
BTW, a similar idea was used more recently with the blow-molded Hardigg cases that will hold a dozen M16 rifles. Many of these were released as surplus, and were available for less than $300 (not including shipping). These have good gaskets and have fittings so that you can induce a vacuum if you have the right equipment. The downside is that these are pretty much specific to the M16/M4 rifles. It's also unclear for how long the vacuum inside can be maintained. The 1950's Springfield canisters were welded shut, while the Hardigg cases rely on gaskets.