Despite the duality, there are reasons to expect that the surjective version behaves better than the injective version for free modules over an arbitrary commutative ring. For example, if $m\leq n$, then any surjection $A^n\to A^m$ has a right inverse (just because the target is free), but not every injection $A^m\to A^n$ has a left inverse.
Depending on the purpose, there are several ways to answer this question.
- Always, except that you need to "shrink $\mathrm{Spec}\,A$", i.e., localize $A$.
The precise statement: Let $\mathfrak{m}$ be a fixed maximal ideal of $A$. If $v_1,\dots,v_n$ generate $A^m$, then there is an element $f\notin \mathfrak{m}$ such that some $m$-element subset of $\{v_1/1,\dots,v_n/1\}$ is a basis of $A_f^m$.
Proof. The generating set $v_1,\dots,v_n$ gives a surjection $A^n\to A^m$. Tensoring with $A/\mathfrak{m}$ gives a surjection $k^n\to k^m$, where $k=A/\mathfrak{m}$ is the quotient field. Hence $\bar v_i$ (the reductions of $v_i$ mod $\mathfrak{m}$, viewed as a vector in $k^m$) for $1\le i\le n$ span $k^m$. By linear algebra, $m$ of the vectors, say $\bar v_1,\dots,\bar v_m$, form a basis of $k^m$. Let $f$ be the determinant of the $m\times m$ $A$-matrix $[v_1 \dots v_m]$. Then $f\notin \mathfrak{m}$ by the above. Moreover, the determinant of $[v_1/1\dots v_m/1]$ is invertible in $A_f$, so $\{v_1/1,\dots,v_m/1\}$ is a basis of $A_f^m$.
- Maybe tangential but related. Sometimes, the reason to want to pick out a basis is to get a "pivot" to do Gauss eliminations. Not having a basis doesn't necessarily prevent us from doing that. Say $A=\mathbb Z$, the free module is $M=A^1$, and the generating set is $\{3,2\}$. Then there is no invertible $1\times 1$ minor in the $A$-matrix $[3\; 2]$. However, we can still show the matrix is column equivalent to the matrix $[1\;0]$ over $A$: just subtract $3$ by $2$, getting $[1\; 2]$, and then use the $1$ to kill the $2$. You might expect the following statement.
Thm??: Suppose a matrix $T:A^n\to A^m$ is surjective, where $n\geq m$. Then there is $U\in \mathrm{GL}_n(A)$ such that $TU=[\mathrm{Id}_m\; O_{m\times (n-m)}]$.
This is false!! If such $U$ exists, then since $\ker(T)$ is isomorphic to $\ker(TU)$, it must be free. But there is an example where the kernel of a surjective map between free modules is not free, see this answer.