Let the sides of the two squares be \(x\) and \(y\). Then, the areas of the squares are \(x^2\) and \(y^2\), and we are given that:
\[
x^2 + y^2 = 625
\]
The perimeters of the squares are \(4x\) and \(4y\), and we are given that:
\[
4x - 4y = 20 \quad \Rightarrow \quad x - y = 5
\]
Now, we have the system of equations:
1. \(x^2 + y^2 = 625\)
2. \(x - y = 5\)
Solving these equations:
From the second equation, \(x = y + 5\). Substituting this into the first equation:
\[
(y + 5)^2 + y^2 = 625 \quad \Rightarrow \quad y^2 + 10y + 25 + y^2 = 625
\]
\[
2y^2 + 10y - 600 = 0 \quad \Rightarrow \quad y^2 + 5y - 300 = 0
\]
Solving this quadratic equation gives \(y = 15\). Substituting \(y = 15\) into \(x = y + 5\), we get \(x = 20\). Thus, the sides of the two squares are 20 m and 15 m.