Separability + local compactness of $G_1$ ensures that $G_1$ is $\sigma$-compact. Hence, by the Baire property of $G_2$ and surjectivity of $\pi$, we deduce the existence of a compact subset $K$ in $G_1$ such that $\pi(K)$ has nonempty interior, and by translating (using that $\pi$ is a homomorphism) we can suppose its interior contains $1$.
Now conclude, by showing that $\pi$ is a proper map. Indeed otherwise there exists a sequence $(g_n)$ in $G_1$ tending to infinity such that $(\pi(g_n))$ is bounded, and after extracting, we can suppose that $(\pi(g_n))$ converges, say to $\pi(g)$. Hence for large $n$ we have $\pi(g^{-1}g_n)\in \pi(K)$, and hence, by injectivity of $\pi$, $g^{-1}g_n\in K$, contradicting that $g_n\to\infty$.
Let me add details (requested in a comment) about two elementary claims above:
Every separable locally compact group $G$ is $\sigma$-compact.
Let $\Gamma$ be a dense countable subset, and let $H$ be a compactly generated open subgroup. I claim that $G=H\Gamma$. Indeed, for $g\in G$, $Hg$ is a neighborhood of $g$, hence contains an element $t$ of $\Gamma$. So $t\in Hg$, write $h=gt^{-1}$: then $h\in H$, and $g=ht$. Since both $H$ and $\Gamma$ are $\sigma$-compact, so is $G$.
Any proper map $f:X\to Y$ between (Hausdorff) locally compact topological spaces is closed.
(Here "proper" is defined as: the inverse image of any compact subset is compact.)
Indeed passing to a closed subset, it is enough to prove that $f(X)$ is closed. Let $y$ be a limit point of $f(X)$. Let $W$ be a compact neighborhood of $y$. Then $f^{-1}(W)$ is compact. Hence $f(f^{-1}(W))$ is compact too. But $f(f^{-1}(W))=W\cap f(X)$ (the latter equality holds for every map between sets). So $W\cap f(X)$ is compact. Since it contains $y$ in its closure, it contains $y$.