Consider the surface group $S_g=\langle a_1,b_1,a_2,b_2,\dots,a_g,b_g \mid [a_1,b_1][a_2,b_2]\cdots[a_{g},b_{g}]=1\rangle$, which is the fundamental group of the closed orientable genus-$g$ surface.
Suppose $2\leq m<n$ and let $p:S_n\to S_m$ be the canonical projection, which is the identity on generators $a_i,b_i$, $1\leq i\leq m$ and which trivializes $a_i,b_i$, $m+1\leq i\leq n$. Let $F_r$ denote the free group with rank $r$.
Question: Is it possible to have finite rank free group $F_r$ and epimorphisms $f:S_n\to F_r$ and $g:F_r\to S_m$ such that $g\circ f=p$?
There is apparently a kind of classification of epimorphisms of surface groups onto free groups that seems relevant (in the following reference). However, I have not been able to see exactly how it helps answer this question.
R. I. Grigorchuk, P. F. Kurchanov, and H. Zieschang, “Equivalence of homomorphisms of surface groups to free groups and some properties of 3-dimensional handlebodies,” Preprint, Ruhr-Universität Bochum, 1990.
The classification: If $r>n$, then no epimorphism $S_n\to F_r$ can exist. Apparently, when $r\leq n$, then there is only one epimorphism $S_n\to F_r$ "up to automorphism." The representative is this: choose $F:S_n\to F_r$ to send $a_i$, $1\leq i\leq r$ to the free generators and trivialize all other generators. This is unique in the sense that for any other epimorphism $f:S_n\to F_r$, we must have $F=f\circ \sigma$ for some $\sigma\in Aut(S_n)$.
Considering this classification and the structure of $p$, my feeling is that the question has a negative answer but that I am perhaps overlooking something simple.