I heard a sharp bang and felt the cockpit instantly depressurize. The roar of the wind followed.
NATOPS (OPNAVINST 3710.7) forbids flight above 25,000 feet in unpressurized aircraft. The A-6 can certainly fly above 25,000 feet. Its listed service ceiling was at 40,000 feet.
So yes, the cockpit is pressurized.
The mask ensures getting the mix of oxygen and all else "just right" while you are flying, among other things.
essexlad, you have it about right.