[proofplan]
We first prove the set-theoretic statement by a monotone class argument: the collection of all sets $E \in \mathcal{A} \otimes \mathcal{B}$ whose $x$-sections $E_x$ lie in $\mathcal{B}$ for every $x$ is shown to be a sigma-algebra containing all measurable rectangles, hence it equals $\mathcal{A} \otimes \mathcal{B}$. The function statement then follows by reducing to the set case via preimages: for a measurable function $f$, the preimage $f^{-1}((-\infty, a))$ is a product-measurable set, and its $x$-section is $f_x^{-1}((-\infty, a))$, which inherits measurability from the set result. The $y$-section case is symmetric throughout.
[/proofplan]
[step:Define the good collection and verify it contains all measurable rectangles]
Fix $x \in X$. For any set $E \subset X \times Y$, the $x$-section is $E_x = \{y \in Y : (x, y) \in E\}$. Define the collection
\begin{align*}
\mathcal{G} = \{E \in \mathcal{A} \otimes \mathcal{B} : E_x \in \mathcal{B} \text{ for every } x \in X\}.
\end{align*}
We verify that $\mathcal{G}$ contains all measurable rectangles. Let $A \in \mathcal{A}$ and $B \in \mathcal{B}$. For the rectangle $E = A \times B$, the $x$-section is
\begin{align*}
(A \times B)_x = \begin{cases} B & \text{if } x \in A, \\ \varnothing & \text{if } x \notin A. \end{cases}
\end{align*}
Since $B \in \mathcal{B}$ and $\varnothing \in \mathcal{B}$, we have $(A \times B)_x \in \mathcal{B}$ for every $x \in X$. Hence $A \times B \in \mathcal{G}$.
[/step]
[step:Verify that $\mathcal{G}$ is a sigma-algebra]
We check the three sigma-algebra axioms for $\mathcal{G}$.
**Contains the empty set.** $\varnothing_x = \varnothing \in \mathcal{B}$ for every $x$, so $\varnothing \in \mathcal{G}$.
**Closed under complements.** Let $E \in \mathcal{G}$. For any $x \in X$,
\begin{align*}
(E^c)_x = \{y \in Y : (x, y) \notin E\} = Y \setminus E_x = (E_x)^c.
\end{align*}
Since $E_x \in \mathcal{B}$, the complement $(E_x)^c \in \mathcal{B}$. Hence $E^c \in \mathcal{G}$.
**Closed under countable unions.** Let $(E_k)_{k=1}^\infty$ be a sequence in $\mathcal{G}$. For any $x \in X$,
\begin{align*}
\left(\bigcup_{k=1}^\infty E_k\right)_x = \{y \in Y : (x, y) \in \bigcup_{k=1}^\infty E_k\} = \bigcup_{k=1}^\infty \{y \in Y : (x, y) \in E_k\} = \bigcup_{k=1}^\infty (E_k)_x.
\end{align*}
Each $(E_k)_x \in \mathcal{B}$, and $\mathcal{B}$ is a sigma-algebra, so the countable union $\bigcup_{k=1}^\infty (E_k)_x \in \mathcal{B}$. Hence $\bigcup_{k=1}^\infty E_k \in \mathcal{G}$.
Therefore $\mathcal{G}$ is a sigma-algebra on $X \times Y$.
[/step]
[step:Conclude that every product-measurable set has measurable sections]
Since $\mathcal{G}$ is a sigma-algebra containing all measurable rectangles $\{A \times B : A \in \mathcal{A}, B \in \mathcal{B}\}$, and $\mathcal{A} \otimes \mathcal{B}$ is by definition the smallest sigma-algebra containing all measurable rectangles, we have
\begin{align*}
\mathcal{A} \otimes \mathcal{B} \subset \mathcal{G}.
\end{align*}
But $\mathcal{G} \subset \mathcal{A} \otimes \mathcal{B}$ by definition (every element of $\mathcal{G}$ is in $\mathcal{A} \otimes \mathcal{B}$). Therefore $\mathcal{G} = \mathcal{A} \otimes \mathcal{B}$: for every $E \in \mathcal{A} \otimes \mathcal{B}$ and every $x \in X$, the section $E_x \in \mathcal{B}$.
The proof that $E^y \in \mathcal{A}$ for every $y \in Y$ is identical, with the roles of $X$ and $Y$ (and $\mathcal{A}$ and $\mathcal{B}$) interchanged: define $\mathcal{G}' = \{E \in \mathcal{A} \otimes \mathcal{B} : E^y \in \mathcal{A} \text{ for every } y \in Y\}$, verify it is a sigma-algebra containing all rectangles, and conclude $\mathcal{G}' = \mathcal{A} \otimes \mathcal{B}$.
[/step]
[step:Deduce measurability of sections for product-measurable functions]
Let $f : X \times Y \to \mathbb{R}$ be $\mathcal{A} \otimes \mathcal{B}$-measurable. Fix $x \in X$. We show that the section $f_x : Y \to \mathbb{R}$ defined by $f_x(y) = f(x, y)$ is $\mathcal{B}$-measurable.
It suffices to show that $f_x^{-1}((-\infty, a)) \in \mathcal{B}$ for every $a \in \mathbb{R}$, since the half-lines $(-\infty, a)$ generate $\mathcal{B}(\mathbb{R})$. Compute:
\begin{align*}
f_x^{-1}((-\infty, a)) &= \{y \in Y : f_x(y) < a\} = \{y \in Y : f(x, y) < a\} = \{y \in Y : (x, y) \in f^{-1}((-\infty, a))\}.
\end{align*}
Since $f$ is $\mathcal{A} \otimes \mathcal{B}$-measurable, the set $E := f^{-1}((-\infty, a)) \in \mathcal{A} \otimes \mathcal{B}$. By the set-theoretic result established above, $E_x \in \mathcal{B}$. But $E_x = \{y \in Y : (x, y) \in E\} = f_x^{-1}((-\infty, a))$. Therefore $f_x^{-1}((-\infty, a)) \in \mathcal{B}$.
Since this holds for every $a \in \mathbb{R}$, the function $f_x$ is $\mathcal{B}$-measurable.
The proof that $f^y : X \to \mathbb{R}$ is $\mathcal{A}$-measurable for every $y \in Y$ is symmetric: $(f^y)^{-1}((-\infty, a)) = (f^{-1}((-\infty, a)))^y \in \mathcal{A}$ by the $y$-section result.
[/step]