Let $f:X\longrightarrow Y$ be a finite, flat morphism of schemes. Then, we know that $f_*\mathcal{O}_X$ is flat over $Y$, and also that $f_*\mathcal{O}_X$ is a coherent $\mathcal{O}_Y$ module.
We know from commutative algebra that, a finitely generated module $M$ over a local ring $R$ is a flat $R$-module if and only if $M$ is a free module.
From this, since $f_*\mathcal{O}_X$ is flat over $Y$ and coherent, $f_*\mathcal{O}_X$ is a locally free $\mathcal{O}_Y$ module.
But the book I am reading (Ueno), claims that $f_*\mathcal{O}_X$ is free as well. Why is this? I am not able to get it.

Any help will be appreciated!
I think it's just a typo in Ueno's book. In general, the finite flat morphisms to a noetherian scheme $Y$ correspond 1:1 to quasi-coherent $\mathcal{O}_Y$-algebras whose underlying $\mathcal{O}_Y$-module is locally free of finite rank, and there is no reason to expect this module to be (globally) free.
Example: Let $I$ be a non-principal fractional ideal in a Dedekind domain $A$. Then the $A$-module $I \oplus A$ is not free (May's notes, Cor. 6.8), but locally free since $I$ is (Theorem 5.1), and carries the structure of an $A$-algebra with $I^2=0$. Now take $\mathrm{Spec}(A \oplus I) \to \mathrm{Spec}(A)$.