Let $(X,d)$ be a compact metric space, let $(Y,\rho)$ be an arbitrary metric space. Let $\mathcal{B}(\mathbb{R}),\mathcal{B}(X),\mathcal{B}(Y),\mathcal{B}(X\times X), \mathcal{B}(Y\times Y)$ denote the Borel sigma-algebras on $\mathbb{R},X,Y,X\times X,Y\times Y$, where the two latter ones are assumed to be equipped with the product topology. Let $f\colon X\to Y$ be a Borel map, i.e. $\big(\mathcal{B}(X),\mathcal{B}(Y)\big)$-measurable. Consider the function $\Delta\colon X\times X\to [0,+\infty)$ given by \begin{equation} \Delta(x,x')= \rho\big(f(x),f(x')\big). \end{equation} It is trivial to see that $\Delta(x,\cdot)$ is Borel, i.e. $\big(\mathcal{B}(X),\mathcal{B}(\mathbb{R})\big)$-measurable, for any fixed $x\in X$ and vice versa. However, the question whether $\Delta$ is Borel, i.e. $\big(\mathcal{B}(X\times X), \mathcal{B}(\mathbb{R})\big)$-measurable, seems more subtle. The problem is in $Y$ here. The map $(f\times f)\colon (X\times X)\to (Y\times Y)$ given by \begin{equation} (f\times f)(x,x')=\big(f(x),f(x')\big) \end{equation} is definetely $\Big(\mathcal{B}(X)\otimes \mathcal{B}(X),\mathcal{B}(Y)\otimes \mathcal{B}(Y)\Big)$-measurable. Since $X$ is separable, then $\mathcal{B}(X\times X)=\mathcal{B}(X)\otimes \mathcal{B}(X)$, so $f\times f$ is $\Big(\mathcal{B}(X\times X),\mathcal{B}(Y)\otimes \mathcal{B}(Y)\Big)$-measurable. So, since $\Delta=\rho\circ (f\times f)$, for the desired property it is enough to show that $\rho$ is $\big(\mathcal{B}(Y)\otimes \mathcal{B}(Y), \mathcal{B}(\mathbb{R})\big)$-measurable. The map $\rho$, as being continuous, is Borel, i.e. $\big(\mathcal{B}(Y\times Y), \mathcal{B}(\mathbb{R})\big)$-measurable. But if $Y$ is not separable, then it may turn out that the inclusion $ \mathcal{B}(Y)\otimes \mathcal{B}(Y)\subset\mathcal{B}(Y\times Y) $ is strict.
Thus, my question is about whether it is true, by probably different arguments, that $\Delta$ is Borel without the requirement that $Y$ is separable. In fact, $(X,d)$ is also equipped with a finite complete Borel measure $\mu$ in my case. Thus, it is probably possible to show a weaker property that $\Delta$ is $\Big(\mathcal{A}(\mu\overline{\otimes} \mu),\mathcal{B}(\mathbb{R})\Big)$-measurable, where $\mathcal{A}(\mu\overline{\otimes} \mu)$ denotes the sigma-algebra of $\mu\overline{\otimes} \mu$-measurable subsets of $X\times X$.
Will be grateful for any help!