Each word has a probability of $\frac 1m$ of matching. Hence the expected number of matches is $\frac nm$. As expectation is linear (with no assumption on independence), this is the answer regardless of whether you replace or not.
Just as an illustration: Suppose $m=2=n$. Let's suppose the words are $A,B$ and that the given sentence $S$ is $AB$.
With replacement: the random sentence can be $\{AA,AB,BA,BB\}$ each with probability $\frac 14$. The respective match scores are $\{1, 2,0,1\}$ so the expected number of matches is $\frac 14\times \left(1+2+0+1\right)=1$.
Without replacement: the random sentence can be $\{AB,BA\}$ each with probability $\frac 12$. The respective match scores are $\{2,0\}$ so the expected number of matches is $\frac 12\times \left(2+0\right)=1$.