On your question. Oxygen+Water+Metal with Iron= Rust. So you put your gun in a vacuum bag. Assuming the gun is oiled and dry when its put in the bag, and then you suck all the air out of it. You no longer have an enviroment that promotes the process of iron oxidation, and then you have much less chance of rust.
If you want to make yourself something that will keep your firearms in a rust free place. There are some types of ultra hydrophobic coatings that can be applied to just about anything. Water pretty much jumps off it.
Coating the outside of an ordinary bag with it, and keeping some type of reusable desiccant system inside the bag would make the inside of your bag a very dry place.
This stuff is a little pricey, but probably well worth it for a range bag. This stuff is a little different in it also being oleophobic, which means it also repels oil. You could sit your bag down in the mud or even an oil spill, pick it up, and it will be as clean and dry as it was before being put in the mud/oil spill. Don't coat your gun with it because it will no longer stay oiled at all.
Some kind of desiccant system in the bag is going to be necessary because the coating will not allow any water in the bag to escape. These are cheap and many are easily reusable.