Let $X,Y$ be measurable functions between measurable spaces $(\Omega,\mathcal A)$ and $(E,\mathcal E)$. Is $\left\{X=Y\right\}\in\mathcal A$?
Clearly, if $E$ is a topological vector space and $\mathcal E$ is the Borel $\sigma$-algebra $\mathcal B(E)$ on $E$ for which $\left\{0\right\}\in\mathcal E$ (e.g. $E$ being a $T_1$-space), then $\left\{X=Y\right\}=(X-Y)^{-1}(\left\{0\right\})\in\mathcal A$.
In your example, you took $E$ a topological vector space.
Take $\Omega = E \times E$, with the corresponding identity on $\sigma$-algebras, $X$ and $Y$ be the coordinate projections, the question proves to be equivalent to « is the diagonal of $E \times E$ measurable? »
Take $E=\{0,1,2\}$, and $\mathcal{E}=\sigma(\{0\},\{1,2\})$, you can check that the answer is no.