I would not use a foam case for storage but I will use them for temporary transport. When stored indoors, most home HVAC systems will maintain a fairly stable environment where moisture is typically below what is necessary to rust quickly. Of course there are places like cellars, basements and laundry rooms which are generally ill suited for firearms storage ( due to moisture). I keep my firearms in a safe (in the closet) and I inspect and oil them regularly. I do have a can of desiccant in the bottom that I do change every 6 months. I have never had any issue at all with rust and I live in the humid south. Even the shotgun I have behind the bedroom door has never rusted in 25 years.
Firearms can and do rust (even indoors) but if you make a reasonable effort to care for them, it typically does not have to be anything on a grand scale. I know that my personal storage routine is rather conservative at best. I dont try all that hard and I dont worry about it. If they were outdoors in a tack room or trunk of a vehicle 24/7 then yeah, I would be more concerned.