[step:Prove the integral identity from the pushforward definition]Let
\begin{align*}
c:X\times Y\to[0,\infty]
\end{align*}
be $\mathcal A\otimes\mathcal B$-measurable. Since $S$ is measurable, the composition
\begin{align*}
c\circ S:X\to[0,\infty],\quad (c\circ S)(x)=c(x,T(x)),
\end{align*}
is $\mathcal A$-measurable.
First let $E\in\mathcal A\otimes\mathcal B$ and consider the indicator function $\mathbb{1}_E:X\times Y\to[0,\infty]$. By the definition of pushforward measure,
\begin{align*}
\int_{X\times Y}\mathbb{1}_E(x,y)\,d\pi(x,y)=\pi(E)=\mu(S^{-1}(E)).
\end{align*}
Also,
\begin{align*}
\int_X \mathbb{1}_E(S(x))\,d\mu(x)=\int_X \mathbb{1}_{S^{-1}(E)}(x)\,d\mu(x)=\mu(S^{-1}(E)).
\end{align*}
Thus the identity holds for indicator functions.
By linearity of the integral for nonnegative simple functions, if
\begin{align*}
\varphi:X\times Y\to[0,\infty]
\end{align*}
is an $\mathcal A\otimes\mathcal B$-measurable [simple function](/page/Simple%20Function), then
\begin{align*}
\int_{X\times Y}\varphi(x,y)\,d\pi(x,y)=\int_X \varphi(S(x))\,d\mu(x).
\end{align*}
Choose a sequence of nonnegative $\mathcal A\otimes\mathcal B$-measurable simple functions
\begin{align*}
\varphi_n:X\times Y\to[0,\infty]
\end{align*}
such that $0\leq \varphi_n\leq \varphi_{n+1}$ for every $n\in\mathbb N$ and $\varphi_n(x,y)\to c(x,y)$ for every $(x,y)\in X\times Y$. Then $\varphi_n\circ S:X\to[0,\infty]$ is nonnegative, $\mathcal A$-measurable, increasing in $n$, and satisfies
\begin{align*}
\varphi_n(S(x))\to c(S(x))=c(x,T(x))
\end{align*}
for every $x\in X$. By the definition of the integral of a nonnegative measurable function as the limit of increasing simple approximations,
\begin{align*}
\int_{X\times Y} c(x,y)\,d\pi(x,y)=\lim_{n\to\infty}\int_{X\times Y}\varphi_n(x,y)\,d\pi(x,y).
\end{align*}
For each $n$, the simple-function case gives
\begin{align*}
\int_{X\times Y}\varphi_n(x,y)\,d\pi(x,y)=\int_X \varphi_n(S(x))\,d\mu(x).
\end{align*}
Taking the limit again by the definition of the nonnegative integral,
\begin{align*}
\lim_{n\to\infty}\int_X \varphi_n(S(x))\,d\mu(x)=\int_X c(S(x))\,d\mu(x).
\end{align*}
Since $c(S(x))=c(x,T(x))$, we obtain
\begin{align*}
\int_{X\times Y} c(x,y)\,d\pi(x,y)=\int_X c(x,T(x))\,d\mu(x).
\end{align*}[/step]