Step 1: Set up right angles using trigonometry instead of AA similarity.
Let $\angle B=\beta$. Since $\angle A=90^\circ$, triangle $AGF$ is right-angled at $A$, and because $DEFG$ is a square with $GF\parallel BC$, the corresponding angle $\angle AGF=\beta$.
Step 2: Express AF using the tangent ratio in triangle AGF.
$\tan\beta=\frac{AF}{AG}$.
Step 3: Express GD using the tangent ratio in triangle GDB.
Since $GD\perp BC$, triangle $GDB$ is right-angled at $D$ with $\angle B=\beta$, so $\tan\beta=\frac{GD}{DB}$.
Step 4: Equate the two expressions for $\tan\beta$.
$\frac{AF}{AG}=\frac{GD}{DB} \implies AF\times DB = AG\times GD$. Hence $AG\times DG=AF\times DB$ is proved.