We first reduce to the case where $X \to S$ has a section. Say $S = \Spec(A)$. Choose a closed point $\xi$ of $X_\eta$. Choose an extension of discrete valuation rings $A \subset B$ such that the fraction field of $B$ is $\kappa(\xi)$. This is possible by Krull-Akizuki (Algebra, Lemma \ref{algebra-lemma-integral-closure-Dedekind}) and the fact that $\kappa(\xi)$ is a finite extension of the fraction field of $A$. By the valuative criterion of properness (Morphisms, Lemma \ref{morphisms-lemma-characterize-proper}) we get a $B$-valued point $\tau : \Spec(B) \to X$ which induces a section $\sigma : \Spec(B) \to X_B$. For a finite locally free $\mathcal{O}_X$-module $\mathcal{E}$ let $\mathcal{E}_B$ be the pullback to the base change $X_B$. By flat base change (Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology}) we see that $H^0(X_B, \mathcal{E}_B) = H^0(X, \mathcal{E}) \otimes_A B$. Thus if $\mathcal{E}_B$ is free of rank $r$, then the sections in $H^0(X, \mathcal{E})$ generate the free $B$-module $\tau^*\mathcal{E} = \sigma^*\mathcal{E}_B$. In particular, we can find $r$ global sections $s_1, \ldots, s_r$ of $\mathcal{E}$ which generate $\tau^*\mathcal{E}$. Then $$ s_1, \ldots, s_r : \mathcal{O}_X^{\oplus r} \longrightarrow \mathcal{E} $$ is a map of finite locally free $\mathcal{O}_X$-modules of rank $r$ and the pullback to $X_B$ is a map of free $\mathcal{O}_{X_B}$-modules which restricts to an isomorphism in one point of each fibre. Taking the determinant we get a function $g \in \Gamma(X_\eta, \mathcal{O}_{X_B})$ which is invertible in one point of each fibre. As the fibres are proper and connected, we see that $g$ must be invertible (details omitted; hint: use Varieties, Lemma \ref{varieties-lemma-proper-geometrically-reduced-global-sections}). Thus it suffices to prove the lemma for the base change $X_B \to \Spec(B)$. \medskip\noindent Assume we have a section $\sigma : S \to X$. Let $\mathcal{E}$ be a finite locally free $\mathcal{O}_X$-module which is assumed free on the generic fibre and on $X_n$ (we will choose $n$ later). Choose an isomorphism $\sigma^*\mathcal{E} = \mathcal{O}_S^{\oplus r}$. Consider the map $$ K = R\Gamma(X, \mathcal{E}) \longrightarrow R\Gamma(S, \sigma^*\mathcal{E}) = A^{\oplus r} $$ in $D(A)$. Arguing as above, we see $\mathcal{E}$ is free if (and only if) the induced map $H^0(K) = H^0(X, \mathcal{E}) \to A^{\oplus r}$ is surjective. \medskip\noindent Set $L = R\Gamma(X, \mathcal{O}_X^{\oplus r})$ and observe that the corresponding map $L \to A^{\oplus r}$ has the desired property. Observe that $K \otimes_A Q(A) \cong L \otimes_A Q(A)$ by flat base change and the assumption that $\mathcal{E}$ is free on the generic fibre. Let $\pi \in A$ be a uniformizer. Observe that $$ K \otimes_A^\mathbf{L} A/\pi^m A = R\Gamma(X, \mathcal{E} \xrightarrow{\pi^m} \mathcal{E}) $$ and similarly for $L$. Denote $\mathcal{E}_{tors} \subset \mathcal{E}$ the coherent subsheaf of sections supported on the special fibre and similarly for other $\mathcal{O}_X$-modules. Choose $k > 0$ such that $(\mathcal{O}_X)_{tors} \to \mathcal{O}_X/\pi^k \mathcal{O}_X$ is injective (Cohomology of Schemes, Lemma \ref{coherent-lemma-Artin-Rees}). Since $\mathcal{E}$ is locally free, we see that $\mathcal{E}_{tors} \subset \mathcal{E}/\pi^k\mathcal{E}$. Then for $n \geq m + k$ we have isomorphisms \begin{align*} (\mathcal{E} \xrightarrow{\pi^m} \mathcal{E}) & \cong (\mathcal{E}/\pi^k\mathcal{E} \xrightarrow{\pi^m} \mathcal{E}/\pi^{k + m}\mathcal{E}) \\ & \cong (\mathcal{O}_X^{\oplus r}/\pi^k\mathcal{O}_X^{\oplus r} \xrightarrow{\pi^m} \mathcal{O}_X^{\oplus r}/\pi^{k + m}\mathcal{O}_X^{\oplus r}) \\ & \cong (\mathcal{O}_X^{\oplus r} \xrightarrow{\pi^m} \mathcal{O}_X^{\oplus r}) \end{align*} in $D(\mathcal{O}_X)$. This determines an isomorphism $$ K \otimes_A^\mathbf{L} A/\pi^m A \cong L \otimes_A^\mathbf{L} A/\pi^m A $$ in $D(A)$ (holds when $n \geq m + k$). Observe that these isomorphisms are compatible with pulling back by $\sigma$ hence in particular we conclude that $K \otimes_A^\mathbf{L} A/\pi^m A \to (A/\pi^m A)^{\oplus r}$ defines an surjection on degree $0$ cohomology modules (as this is true for $L$). Since $A$ is a discrete valuation ring, we have $$ K \cong \bigoplus H^i(K)[-i] \quad\text{and}\quad L \cong \bigoplus H^i(L)[-i] $$ in $D(A)$. See More on Algebra, Example \ref{more-algebra-example-finite-injective-finite-global-dimension}. The cohomology groups $H^i(K) = H^i(X, \mathcal{E})$ and $H^i(L) = H^i(X, \mathcal{O}_X)^{\oplus r}$ are finite $A$-modules by Cohomology of Schemes, Lemma \ref{coherent-lemma-proper-over-affine-cohomology-finite}. By More on Algebra, Lemma \ref{more-algebra-lemma-generalized-valuation-ring-modules} these modules are direct sums of cyclic modules. We have seen above that the rank $\beta_i$ of the free part of $H^i(K)$ and $H^i(L)$ are the same. Next, observe that $$ H^i(L \otimes_A^\mathbf{L} A/\pi^m A) = H^i(L)/\pi^m H^i(L) \oplus H^{i + 1}(L)[\pi^m] $$ and similarly for $K$. Let $e$ be the largest integer such that $A/\pi^eA$ occurs as a summand of $H^i(X, \mathcal{O}_X)$, or equivalently $H^i(L)$, for some $i$. Then taking $m = e + 1$ we see that $H^i(L \otimes_A^\mathbf{L} A/\pi^m A)$ is a direct sum of $\beta_i$ copies of $A/\pi^m A$ and some other cyclic modules each annihilated by $\pi^e$. By the same reasoning for $K$ and the isomorphism $K \otimes_A^\mathbf{L} A/\pi^m A \cong L \otimes_A^\mathbf{L} A/\pi^m A$ it follows that $H^i(K)$ cannot have any cyclic summands of the form $A/\pi^l A$ with $l > e$. (It also follows that $K$ is isomorphic to $L$ as an object of $D(A)$, but we won't need this.) Then the only way the map $$ H^0(K \otimes^\mathbf{L}_A A/\pi^{e + 1} A) = H^0(K)/\pi^{e + 1}H^0(K) \oplus H^1(K)[\pi^{e + 1}] \longrightarrow (A/\pi^{e + 1} A)^{\oplus r} $$ is surjective, is if it is surjective on the first summand. This is what we wanted to show. (To be precise, the integer $n$ in the statement of the lemma, if there is a section $\sigma$, should be equal to $k + e + 1$ where $k$ and $e$ are as above and depend only on $X$.)