Any module having such a decomposition is free if it is torsion-free. So in both cases, it suffices to give an example of a torsion-free module that is not free.
Let $R$ be a domain that is not a PID, then there exists some ideal $I \subset R$ that is not principal. I claim that $I$ is not free as an $R$-module. Indeed, from the injection $I \to R$, we get that the rank of $I$ is one. So if $I$ is a free $R$-module, it must be free of rank one. But then $R \cong I$, which implies that $I$ is principal.
Consider $R=\Bbb Z$ and $M=\Bbb Q$. $\Bbb Q$ is torsion-free, but it is also divisible. No free $\Bbb Z$-module is divsible, because $\Bbb Z$ is not divisible as a $\Bbb Z$-module.
Edit: Here's a proof that there exists a finitely generated $\Bbb Z[X]$-module such that the torsion submodule is not a direct summand. (It's not very explicit, though.)
More generally, let $R$ be a UFD and let $a,b \in R$ such that the ideal $I=(a,b)$ is non-principal, but $\gcd(a,b)=1$. For $R=\Bbb Z[X]$ one can take $a=2,b=X$. (One can always find such elements as long as $R$ is a UFD that is not a PID.)
Now consider the exact sequence $$0 \to R \to R^2 \to (a,b) \to 0$$ where the first map is given by $r \mapsto (br,ar)$ and the second map is given by $(r,s) \mapsto ar-bs$. (One needs to use that $\gcd(a,b)=1$ to get the exactness.) That's a projective resolution of $(a,b)$. We may apply the functor $\mathrm{Hom}_R(-,R/I)$ and get an exact sequence
$$0 \to \mathrm{Hom}_R(I,R/I) \to \mathrm{Hom}_R(R^2,R/I) \to \mathrm{Hom}_R(R,R/I) \to \mathrm{Ext}^1_R(I,R/I) \to 0$$
We can identify $\mathrm{Hom}_R(R^2,R/I) \cong (R/I)^2$ and $\mathrm{Hom}_R(R,R/I) \cong R/I$. Using these identifications, the map $\mathrm{Hom}_R(R^2,R/I) \to \mathrm{Hom}_R(R,R/I)$ corresponds to the map $(R/I)^2 \to R/I$ given by $(\overline{x},\overline{y}) \mapsto \overline{bx+ay}$. But that's just the zero map, because for all $x,y$, we have $bx+ay \in I$. Thus by exactness, we get that $\mathrm{Ext}^1_R(I,R/I) \cong R/I \neq 0$. Thus there exists a non-split exact sequence
$$0 \to R/I \to M \to I \to 0$$
In this situation, $M$ is automatically finitely generated and the image of $R/I \to M$ is the torsion submodule of $M$, because $R/I$ is torsion and $I$ is torsion-free. Thus the torsion submodule of $M$ is not a direct summand, because else the exact sequence would split.
(If one actually chases this through the equivalence of elements of $\mathrm{Ext}^1$ with extensions, one can make this more explicit.)