This answer is not complete. See the comments below.
The modules $E$ and $F$ being free of finite rank $n$ over $A$ means that they each have a finite basis over $A$. Take $y \in F$, and since $f$ is surjective some $x \in E$ maps to $y$. Pick a basis for $\langle e_1, \dots, e_n \rangle$ of $E$ over $A$, so $x = a_1e_1 + \dotsb + a_ne_n$ for some $a_i \in A$. Then for our arbitrary element $y \in F$,
$$
y = f(a_1e_1 + \dotsb + a_ne_n) = a_1f(e_1) + \dotsb + a_nf(e_n)
\,
$$
so $\langle f(e_1),\dotsc, f(e_n)\rangle$ generates $F$. Since $F$ has the same rank as $E$, these generators must form a basis (this needs to be proven. See darij grinberg's comment below). Since these generators form a basis
$$
0 = f(\alpha_1e_1 + \dotsb + \alpha_ne_n) = \alpha_1f(e_1) + \dotsb + \alpha_nf(e_n)
$$
only when the $\alpha_i$ are all zero, so $f$ is injective and hence an isomorphism. ${_\square}$
I don't see why we need $A$ to be a commutative ring. Since we're specifying that $E$ and $F$ have the same rank I assume they have the invariant dimension property. Otherwise commutivity would imply this. Also we're only talking about a single map $f \colon E \to F$ and don't need to talk about the module structure on $\mathrm{Hom}_R(E,F)$, for which we need $R$ to be commutative.
Also I've seen it asked as an exercise, is this still true if we assume $f$ is injective instead of surjective? The answer is no, looking at the counterexample $\mathbf{Z} \to \mathbf{Z}$ where $1 \mapsto 2$, regarding $\mathbf{Z}$ as a rank $1$ free module over itself.