Step 1: Reaction in acidic medium.
In acidic medium,
\[
\mathrm{MnO_4^-}
\]
is reduced to
\[
\mathrm{Mn^{2+}},
\]
while hydrogen peroxide is oxidized to oxygen.
\[
\boxed{
2\mathrm{MnO_4^-}+5\mathrm{H_2O_2}+6\mathrm{H^+}
\rightarrow
2\mathrm{Mn^{2+}}+5\mathrm{O_2}+8\mathrm{H_2O}
}
\]
Hence,
\[
\boxed{X=\mathrm{O_2}}.
\]
Step 2: Reaction in basic medium.
In basic medium,
\[
\mathrm{MnO_4^-}
\]
is reduced to
\[
\mathrm{MnO_2},
\]
and hydrogen peroxide is again oxidized to oxygen.
Hence,
\[
\boxed{Y=\mathrm{O_2}}.
\]
Therefore,
\[
\boxed{X=\mathrm{O_2},\qquad Y=\mathrm{O_2}}
\]
Thus,
\[
\boxed{(C)}
\]
is the correct answer.