There is a general result that can be applied in this situation:
Definition C:
Suppose $(S,\mathscr{S})$ is a measurable space, and $(X,\tau_X)$ and $(Y,\tau_Y)$ topological spaces equipped with the Borel $\sigma$-algebras $\mathscr{B}(\tau_X)$ and $\mathscr{B}(\tau_Y)$. A function $f:S\times X\rightarrow Y$ is called a Caratheodory function if
- $f_s:x\mapsto f(s,x)$ is continuous for each $s\in S$,
- $f_x:s\mapsto f(s,x)$ is $\mathscr{S}-\mathscr{B}(\tau_Y)$ measurable.
Here is a well known result by Carathéodory.
Theorem: If $f$ is as in definition C, $(X,\tau_X)$ is metrizable and separable and $(Y,\tau_Y)$ is metrizable, then $f$ is $\mathscr{S}\otimes\mathscr{B}(\tau_X)-\mathscr{B}(\tau_Y)$ measurable.
A proof of this can be found in Aliprantis, C. and Border, K., Infinite dimensional analysis: A hitchhiker's guide., Third Edition, Springer. pp 153.
In the context of the OP, $S=\mathbb{R}$, $\mathscr{S}=\mathscr{B}(\mathbb{R})$, $X=Y=\mathbb{R}$ also equipped with the Borel $\sigma$-algebra.