There are abelian groups $A$ such that $A\cong A\oplus A \oplus A$ but $A\not\cong A\oplus A$.

Let $E=\operatorname{End}(A)$. The functor $F=\operatorname{Hom}(A,-)$ is an equivalence from the category of finite direct sums of copies of $A$ to the category of finitely generated free $E$-modules.

So $E\oplus E$ is a module with free rank $2$ but is a direct summand of $E\cong E\oplus E\oplus E$, and so has rank $1$.