The masks are there to survive sudden cabin decompression at high altitudes where the atmosphere is too thin to breath. There is only enough oxygen to last a few minutes.
Further reading: https://www.telegraph.co.uk/travel/travel-truths/truth-about...