EEDIT: The accepted answer has been edited and it looks pretty good now. If that answer is completely clear to you, then there is no need for you to read anything below.
For what is mentioned as the point-irreducible closed subset correspondence below (which is also mentioned as "the key fact" above in the accepted answer), I mean the following proposition in Görtz & Wedhorn, Algebraic Geometry I.
Proposition 3.23. Let $X$ be a scheme. The mapping
$$ X\to \{Z\subset X ; Z \text{ is closed and irreducible}\}:x\mapsto \overline{\{x\}}$$
is a bijection, i.e. every irreducible closed subset contains a unique generic point.
EDIT:
For what is below, let $f:X\to Y$ be a closed surjective morphism (sorry to reverse the $X$ and $Y$, but the version of the problem I met is in this notation).
I just noticed that one can reduce to the case where both $X$ and $Y$ are irreducible using the point-irreducible closed subset correspondence: it suffices to show for each irreducible subset $\overline{\{y’\}}=Y’\subset Y$ that $\dim f^{-1}(Y’)\geq \dim Y’ $, and by choosing $x’\in X$ such that $f(x’)=y’$ we need only show $\dim\overline{\{ x’\}}\geq \dim \overline{\{y’\}}$. It is now that the case where $\dim X=0$ becomes trivial, and the induction step in the first paragraph of the accepted answer works through. Anyway, I shall post this answer here as a complement.
There is a gap in the currently accepted answer , which I and everyone I can ask failed to figure out how to fix (EEDIT: the gap has been removed), so I decide to post this answer, despite that this question is already three-year old. The instructor of mine told me the following solution.
Let $Y_0\subsetneq \cdots\subsetneq Y_n$ be any chain of irreducible closed subsets of $Y$, the claim is that there exists a chain of irreducible closed subsets of $X$, $X_0\subsetneqq\cdots\subsetneq X_n$, such that $f(X_i)=Y_i$ for each $i$.
Since irreducible closed subsets of schemes are corresponded bijectively to the closures of single point, there is $Y_i=\overline{\{y_i\}}$ for some $y_i\in Y$ for each $i$. Since $f$ is closed, there is $f(\overline{\{x\}})=\overline{\{f(x)\}}$ for any $x\in X$ ($f(\overline{\{x\}})\supset\overline{\{f(x)\}}$ is clear by closeness of $f$; note that $x\in f^{-1}(\overline{\{f(x)\}})$, $\overline{\{x\}}\subset f^{-1}(\overline{\{f(x)\}}) $, hence the converse is also clear).
Now choose by surjectivity $x_n\in X$ such that $f(x_n)=y_n$, it suffices to find inductively that given $x_i\in X$ such that $f(x_i)=y_i$ (consequentially $f(\overline{\{x_i\}})=Y_i$), $x_{i-1}\in \overline{\{x_i\}}$ such that $f(x_{i-1})=y_{i-1}$, which implies that $f(\overline{\{x_{i-1}\}})=Y_{i-1}$ and hence $\overline{\{x_{i-1}\}}\subsetneq \overline{\{x_i\}} $ by surjectivity of $f$. Since $y_{i-1}\in \overline{\{y_i\}}=f(\overline{\{x_i\}})$, clearly such $x_{i-1}$ exists, so we are done.
This solution is based on the key fact that an irreducible closed subset of scheme is exactly the closure of a point. I don’t believe this statement is correct for general topological spaces since the irreducible component could have wild behavior, but I haven’t come up with a counterexample yet.