Consider the chromatic polynomial as a sum of monomials: $$P(G, k) = (k - r_1)(k - r_2)\cdots(k - r_n) = k^n + a_1k^{n-1} + \cdots + a_{n-1}k + a_n$$ It has been shown that $a_2 = \binom{e(G)}{2} - c_3(G)$, where $c_3(G)$ is the number of triangles in $G$. For bipartite (and triangle-free graphs in general), we have $a_2 = \binom{e(G)}{2}$. It follows that \begin{align}\sum_{i=1}^n r_i^2 &= (-r_1-r_2-\cdots -r_n)^2 - 2(r_1r_2 + r_1r_3 + \cdots +r_{n-1}r_n)\\ &= a_1^2 - 2a_2\\ &= e(G)^2 - 2 \binom{e(G)}{2}\\ &= e(G)\end{align}