This has nothing to do with Lie groups. Let $X$ be any space, let $S$ be a closed, orientable surface and let $f : S \rightarrow X$ be a map. We then get a canonical homology class $f_{\ast}([S]) \in H_2(X;\mathbb{Z})$. If there exists a closed orientable $3$-manifold $M$ with boundary $S$ such that $f$ extends over $S$, then we are done : the manifold $M$ maps into $X$ to provide a homology between $f_{\ast}([S])$ and $0$. Conversely, assume that $f_{\ast}([S]) = 0$. This implies that $f_{\ast}([S])$ is the boundary of a singular chain mapping into $X$. This singular chain can be thought of as a collection of tetrahedra glued together. Aside from the faces of the tetrahedra which lie in $S$, the faces of these tetrahedra are glued together in pairs. Let $M'$ be the result of gluing these tetrahedra together. We thus have $\partial M' = S$ and a map $F' : M' \rightarrow X$ extending $f$. It is a fun exercise to show that $M'$ is a 3-manifold except possibly at finitely many points $x_1,\ldots,x_n$. A small neighborhood of $x_i$ is homeomorphic to the cone on an oriented surface. Cut out these neighborhoods and glue in handlebodies. We get a $3$-manifold $M$ with $\partial M = S$, and from the construction it is clear that we can modify $F'$ to give a function $F : M \rightarrow X$ which still extends $f$.

The point here is that in low degree, bordism agrees with homology.