The correct options are
A Be
B Mg
Be and Mg are inert to oxygen due to the formation of an oxide film on their surface. So, the correct answer will be option (a) and (b). Calcium, strontium and barium are readily attacked by air to form oxides and nitrides.
Theory
Reactivity towards air:
Be and Mg are inert to oxygen due to the formation of an oxide film on their surface.
Calcium, strontium and barium are readily attacked by air to form oxides and nitrides.
Magnesium is more electropositive
Burns intensely in air to give MgO and Mg3N2