Edit: First answer was incorrect. I misread the question.
Fix our language $\mathscr{L} = \{f\}$ where $f$ is a unary function symbol.
Consider the following sentences:
$\phi_1 \equiv (\forall x)(\forall y)((f(x)=f(y)) \to x=y)$
$\phi_2 \equiv (\forall y)(\exists x)(f(x)=y)$
Now, let $A = \phi_1$ and $B =\phi_2$. $A$ is the statement that $f$ is injective and $B$ is that statement that $f$ is surjective. If $M$ is a finite, then $M \models A \iff M \models B$. However, clearly this is not true for infinite models. Consider $(\mathbb{N};S)$ where $S$ is the successor function. This function is injective but not surjective.