Here is an example of a connected surface with a smooth map onto the threefold $\mathbb R^2\times S^1$.
Consider the Prüfer manifold $X=\left(\coprod_{a\in\mathbb R}\mathbb R^2_a \right)/{\sim}$, where each $\mathbb R^2_a$ is a copy of the real plane, the elements of which I want to denote by $(x,y;a)$ with $x,y\in \mathbb R$, and where the equivalence relation $\sim$ identifies $(x,y;a)\in\mathbb R^2_a$ with $(x',y';b)\in\mathbb R^2_b$ if and only if $y=y'> 0$ and $a+xy=b+x'y'$. Let me denote the class of $(x,y;a)\in \mathbb R^2_a$ in $X$ by $[x,y;a]$.
The obvious map $\pi\colon\coprod_{a\in\mathbb R}\mathbb R^2_a \to X$ defines the smooth structure on $X$, i.e., a map $f\colon X\to Y$ is smooth if and only if the composite $f\circ\pi$ is smooth. In other words, $f$ is smooth if and only if its restriction to each $\mathbb R^2_a$ is smooth. In particular, $[x,y;a]\mapsto y$ defines a smooth function $X\to \mathbb R$, but the maps defined by $x$ and $a$ are well-defined and smooth only on the locus where no glueing is happening, i.e., where $y\leq 0$.
Let $h \colon\mathbb R\to\mathbb R_{\geq 0}$ be a surjective smooth function satisfying $h(x)=0$ for all $x\geq 0$ and $h(x)>0$ for all $x<0$, e.g.,
$$h(x)=\begin{cases}e^{\tfrac{1}{x} - x} & x<0\\0& x\geq 0.\end{cases}$$
There with, we define the map $f\colon X\to\mathbb R^2\times S^1$,
$[x,y;a]\mapsto (a+xy,ah(y),e^{iy})$.
The first and third components are clearly well-defined and smooth.
The second component is well-defined even though $a$ does not define a global function, because on the locus where $a$ is not well-defined, $y>0$ and so $ah(y)=0$. Therefore, $f$ is smooth.
To see that $f$ is surjective, let $(u,v,e^{iy})\in \mathbb R^2\times S^1$ be an arbitrary point. Shifting $y$ by $-2\pi$ as often as necessary, we may assume that $y<0$. Define $a=\frac{v}{h(y)}$ and $x=\frac{uh(y)-v}{yh(y)}$ and observe that $f([x,y;a])=(u,v,e^{iy})$. Thus, $f$ is surjective, as claimed.