How prove this identity wih the sum equal to other sum
Fix $l$ (so we may then drop the $l$ from $g(m,l)$), and let $\alpha_{i,j}=a_{i}-a_j,\beta_{i,j}=b_i-b_j$, $d_{ij}=\alpha_{i,j}-\beta_{i,j}$. Denote by $S$ the main sum $S=\sum_{m=0}^l g(m)$.
Now, let us temporarily fix two indices $i$ and $j$. One can write
$$ g(i)=\frac{1}{d_{ij}}\frac{A(a_i-b_i)}{B(a_i-b_i)} \tag{1} $$
where $A(X)=\prod_{r=0}^{l} (X+b_{r+1}-a_r)$ is independent of $i$ or $j$ and
$$ B(X)=\prod_{1\leq r\leq n, r\neq i,j} (X+b_r-a_r) \tag{2} $$
is symmetrical in $i$ and $j$. It follows that
$$ g(i)+g(j)=\frac{1}{d_{ij}}\Bigg(\frac{A(a_i-b_i)}{B(a_i-b_i)}- \frac{A(a_j-b_j)}{B(a_j-b_j)}\Bigg) $$ and $$ g(i)+g(j)= \frac{\frac{A(a_i-b_i)B(a_j-b_j)-A(a_j-b_j)B(a_i-b_i)}{(a_i-b_i)-(a_j-b_j)}}{B(a_i-b_i)B(a_j-b_j)} \tag{3} $$
But the numerator in (3) above is in fact a polynomial. So, $d_{ij}$ does not appear in the denominator of the reduced fraction for $g(i)+g(j)$. Since $d_{ij}$ does not appear in the denominator of $g(m)$ when $m\neq i,j$, it follows that $d_{i,j}$ does not appear in the denominator of the reduced fraction for $S$.
Since this holds for any $i,j$,it follows that $S$ is a polynomial. Since each $g(m)$ has degree at most $1$ in each of its variables (as a rational fraction), $S$ also has degree at most $1$ in each of its variables.
So $S$ can be written
$$ S=C(a_1,a_2,\ldots,a_l)+\sum_{m=1}^{l} S_m(a_1,a_2,\ldots,a_l) b_m \tag{4} $$
By taking all the $b_k$'s equal to $0$, we see that $C=0$. If we take all the $b_k$'s equal to $0$ except $b_1$, we see that $g(1)=a_1b_1$ and $g(m)=0$ for $m>1$, whence $S_1=a_1$.
More generally, if all the $b_k$'s are equal to $0$ except $b_j$ for $j\gt 1$, then $g(m)=0$ except when $m=j$ or $j-1$, with $g(j-1)=\frac{b_ja_{j-1}(-a_{j-1}+a_j)}{a_{j-1}-a_j+b_j}$ and a similar formula for $g(j)$, so that $S_j=\frac{g(j-1)+g(j)}{b_j}=a_{j}-a_{j-1}$.
This proves your identity.