This is true. Recall the following lemma:
Lemma. Let $X \stackrel i\hookleftarrow Z \stackrel f\to Y$ be a span of affine schemes, where $i$ is a closed immersion. Then the pushout $P = X \underset Z\amalg Y$ in $\mathbf{Sch}$ exists and is affine. If $X$ and $Y$ are reduced, then so is $P$.
Proof. If $X = \operatorname{Spec} A$, $Y = \operatorname{Spec} B$, and $Z = \operatorname{Spec} C$, then [Stacks, Tag 0ET0] shows that the pushout is represented by the affine scheme
$$P = \operatorname{Spec} \big(A \underset C\times B\big).$$
The final statement follows since products and subrings of reduced rings are reduced. $\square$
Thus, it suffices to show the following:
Proposition. Let $f \colon Z \to S$ be a morphism from an affine scheme $Z$ to a reduced scheme $S$. Then there exists a reduced affine scheme $X$, a closed immersion $i \colon Z \hookrightarrow X$, and a morphism $g \colon X \to S$ such that $f = gi$.
Indeed, this immediately settles surjectivity. Moreover, if $Z \hookrightarrow X \to S$ is a factorisation as in the proposition, and $Z \to Y \to S$ is any factorisation with $Y$ affine reduced, then $P = X \amalg_Z Y$ is affine and reduced by the lemma above, giving a third factorisation $Z \to P \to S$ of which both $Z \hookrightarrow X \to S$ and $Z \to Y \to S$ are refinements. The explicit description of colimits in $\mathbf{Set}$ (see e.g. [Tag 002U]) then gives injectivity.
Proof of Proposition. Write $Z = \operatorname{Spec} A$. If the image of $f$ lands in an affine open $V \subseteq S$, say $V = \operatorname{Spec} B$, then we conclude by factoring $B \to A$ as $B \to B[A] \twoheadrightarrow A$, where $B[A]$ is a polynomial algebra with generators $a \in A$ (which is reduced since $B$ is). In general, cover $S$ by affine opens $V_j$ for $j \in J$, and choose a finite standard affine open cover $\coprod_{i=1}^n U_i \twoheadrightarrow Z$ refining the open cover $\coprod_{j \in J}f^{-1}(V_j) \twoheadrightarrow Z$; say $U_i = \operatorname{Spec} A_{f_i}$. Then we know that the result holds for each $U_i$, so pick $U_i \hookrightarrow X_i \to S$ with $X_i = \operatorname{Spec} R_i$ affine and reduced and $U_i \hookrightarrow X_i$ a closed immersion. Consider the diagram
$$\coprod_{i \neq j} U_i \cap U_j \rightrightarrows \coprod_i X_i.\tag{1}\label{1}$$
We claim that the colimit of \eqref{1} exists in $\mathbf{Sch}$ as an affine reduced scheme. Indeed, for each $j \in \{0,\ldots,n\}$, consider the diagram
$$\coprod_{i \neq j} U_i \cap U_j \rightrightarrows \Big( \coprod_{i=1}^j X_i \amalg \coprod_{i=j+1}^n U_i \Big)\tag{2}\label{2}.$$
We will prove by induction on $j$ that this diagram has an affine colimit in $\mathbf{Sch}$. For $j = 0$, the colimit is simply $Z$. If the diagram \eqref{2} has an affine colimit $P_j$ for some value of $j$, then the diagram for $j+1$ has affine colimit $P_{j+1} = P_j \underset{U_{j+1}}\amalg X_{j+1}$ by the lemma above.
This proves that \eqref{1} has an affine colimit $X = P_n$ in $\mathbf{Sch}$; say $X = \operatorname{Spec} R$. Applying the universal property to $\operatorname{Hom}(-,\mathbf A^1_{\mathbf Z})$ shows that
$$R = \lim \Big( \prod_{i=1}^n R_i \rightrightarrows \prod_{i \neq j} A_{f_if_j} \Big),$$
which is reduced since each $R_i$ is. The map $P_0 \to P_n$ is a closed immersion $i \colon Z \hookrightarrow X$, and the universal property of the colimit of \eqref{1} gives a morphism $g \colon X \to S$ such that $f = gi$. $\square$