The system's acceleration is expressed as:
\[ a = \frac{m_2 - m_1}{m_1 + m_2} g \]
Given that \(a = \frac{g}{\sqrt{2}}\), this value is substituted into the acceleration equation:
\[ \frac{g}{\sqrt{2}} = \frac{m_2 - m_1}{m_1 + m_2} g \]
After simplification:
\[ \frac{1}{\sqrt{2}} = \frac{m_2 - m_1}{m_1 + m_2} \]
Performing cross-multiplication yields:
\[ \sqrt{2}(m_2 - m_1) = m_1 + m_2 \]
Rearranging the terms results in:
\[ m_1(\sqrt{2} + 1) = m_2(\sqrt{2} - 1) \]
The resulting ratio of the masses is:
\[ \frac{m_1}{m_2} = \frac{\sqrt{2} - 1}{\sqrt{2} + 1} \]