The answer is affirmative if $f$ is Borel-measurable. It is suffices to prove the equality for $f$ having finitely many values. Let $V=f(X\times Y)$ be the finite set of values of $f$. By the Borel-measurability of $f$, for every $v\in V$ the set $D_v=f^{-1}(v)$ is Borel and its projection $A_v=pr_X(D_v)$ onto $X$ is analytic.
By the Uniformization Theorem 18.1 (of Jankov and von Neumann) in the book "Classical Descriptive Set Theory" of Kechris, there exist a uniformizing function $s_v:A_v\to D_v$ which is $\sigma(\Sigma^1_1)$-measurable and $pr_X\circ s_v(x)=x$ for all $x\in A_v$. Consider the $\sigma(\Sigma_1^1)$-measurable function $s:X\to X\times Y$ defined by $s(x)=s_{v}(x)$ where $v\in V$ is the unique element of $V$ such that $x\in A_v\setminus \bigcup_{V\ni u<v}A_u$. It follows that $f\circ s=\phi$.
Consider the probability measure $\mu$ on $X\times Y$ defined by $\mu(B)=\nu(s^{-1}(B))$ for any Borel subset $B\subset X\times Y$. This measure is well-defined as $s^{-1}(B)$ belongs to the $\sigma$-algebra $\sigma(\Sigma^1_1)$ and hence is $\nu$-measurable by Lusin Theorem 29.7 (in Kechris' book). If follows that $\int_\mu f(x,y)dxdy=\int_\nu f\circ s(x)dx=\int_\nu \phi(x)dx$.$$\int_{X\times Y} f(x,y)d\mu(x,y)=\int_X f\circ s(x)d\nu(x)=\int_X \phi(x)d\nu(x).$$