Thank you to Mariano Suárez-Alvarez. I think the cohomology ring will work, somthing like this:
We know that the cohomology ring of a genus $g$ surface has the property that any non-zero class in degree one has a class it can cup with to get a non-trivial element of $H^2$ (this could be from direct computation or by Poincare duality.) In the wedge sum, we notice that WLOG $X$ must have trivial $H^2$. Thus any two degree 1 class supported on $X$ cup to 0, and any class supported on $X$ cups to zero with a class supported on $Y$. Thus $X$ has trival $H^1$.
You are incorrect in your calculation of $\pi_1(U_g)$; it's free on $2g+1$ generators. What you need now is that the map $U_g \to U_{g+1}$ induces the map $F_{2g+1} \to F_{2g+3}$ sending the $i$th generator of the first to the $i$th generator of the second. Now we have...
If a space $X$ is the union of a directed set of subspaces $X_\alpha$ ordered by inclusion with the property that each compact set in $X$ is contained in some $X_\alpha$, and each $X_\alpha$ contains a given point $x_0$, then the natural map $\varinjlim \pi_1(X_\alpha,x_0) \to \pi_1(X,x_0)$ is an isomorphism.
Surjectivity follows from the compactness hypothesis; the image of a representing map $f: S^1 \to X$ of an element of $\pi_1(X,x_0)$ lies in some $X_\alpha$, so is in the image of some $f' \in \varinjlim\pi_1(X_\alpha, x_0)$. Suppose $f \in \varinjlim \pi_1(X_\alpha, x_0)$ maps to zero; then we have a null-homotopy $f_t: S^1 \times I \to X$. Since the image of this is compact, this defines a null-homotopy $f_t: S^1 \times I \to X_\alpha$ for some $\alpha$, so $f$ is zero in $\varinjlim \pi_1(X_\alpha, x_0)$ as well.
(This fact, and its proof, is an adaptation of Proposition 3.33 in Hatcher's algebraic topology book.)
Taking the limit of $\pi_1(U_g,x_0)$ gives us that $\pi_1(U) \cong F_\infty$, the free group on countably many generators. Similarly for $\pi_1(V,x_0)$.
Now $U \cap V \cong S^1$, and the inclusion $S^1 \to U, S^1 \to V$ induces the map $F_1 \to F_\infty$ sending the generator of the first to a chosen generator of the second. Thus by the van Kampen theorem, $$\pi_1(U \cup V, x_0) \cong \langle u_1, v_1, u_2, v_2, \dots \, \mid \, u_1 = v_1\rangle,$$
giving $\pi_1(X,x_0) = \pi_1(U \cup V, x_0) \cong F_\infty$ as desired.
Best Answer
The fundamental group of every noncompact connected surface $S$ (oriented or not) is free and the surface itself is homotopy-equivalent to a graph.
See here.