[step:Track mixed commutators by the number of entries from each ideal]For integers $r,s\geq 0$ with $r+s\geq 1$, let $C_{r,s}$ denote the $k$-linear span of all left-normed commutators
\begin{align*}
[x_1,[x_2,\dots,[x_{r+s-1},x_{r+s}]\dots]]
\end{align*}
in which exactly $r$ of the entries $x_1,\dots,x_{r+s}$ lie in $I$ and exactly $s$ lie in $J$.
We claim that, for every $r,s\geq 0$ with $r+s\geq 1$,
\begin{align*}
r>0 &\implies C_{r,s}\subseteq \gamma_r(I),\\
s>0 &\implies C_{r,s}\subseteq \gamma_s(J).
\end{align*}
[claim:Mixed commutators lie in the corresponding lower central terms]
For every $r,s\geq 0$ with $r+s\geq 1$, if $r>0$ then $C_{r,s}\subseteq \gamma_r(I)$, and if $s>0$ then $C_{r,s}\subseteq \gamma_s(J)$.
[/claim]
[proof]
We prove the assertion by induction on $m:=r+s$.
For $m=1$, either $(r,s)=(1,0)$ or $(r,s)=(0,1)$. In the first case, $C_{1,0}=I=\gamma_1(I)$. In the second case, $C_{0,1}=J=\gamma_1(J)$. Thus the assertion holds.
Assume the assertion holds for all pairs whose sum is $m-1$, and fix $r,s\geq 0$ with $r+s=m$. A spanning element of $C_{r,s}$ has the form
\begin{align*}
[x,y],
\end{align*}
where $x\in I$ or $x\in J$, and $y$ is a left-normed commutator of length $m-1$ containing the remaining entries.
Suppose first that $r>0$. If $x\in I$, then $y\in C_{r-1,s}$, and by induction, if $r-1>0$ then $y\in\gamma_{r-1}(I)$; if $r-1=0$, then $y$ is a commutator of entries from $J$, hence $y\in J$. In the first subcase,
\begin{align*}
[x,y]\in[I,\gamma_{r-1}(I)]=\gamma_r(I).
\end{align*}
In the second subcase, $x\in I$ and $y\in J$, so $[x,y]\in I$ because $I\trianglelefteq\mathfrak g$; since $r=1$, this gives $[x,y]\in\gamma_1(I)=I$.
If instead $x\in J$, then the remaining commutator $y$ has $r$ entries from $I$ and $s-1$ entries from $J$. By induction, $y\in\gamma_r(I)$. Since $I\trianglelefteq\mathfrak g$, each lower central term $\gamma_r(I)$ is an ideal of $\mathfrak g$: this follows by induction from the Jacobi identity and the fact that $I$ is an ideal. Hence
\begin{align*}
[x,y]\in[\mathfrak g,\gamma_r(I)]\subseteq\gamma_r(I).
\end{align*}
Thus $C_{r,s}\subseteq\gamma_r(I)$ whenever $r>0$.
We now prove the corresponding assertion for $J$. Suppose that $s>0$. If $x\in J$, then $y\in C_{r,s-1}$. If $s-1>0$, the induction hypothesis gives $y\in\gamma_{s-1}(J)$, and hence
\begin{align*}
[x,y]\in[J,\gamma_{s-1}(J)]=\gamma_s(J).
\end{align*}
If $s-1=0$, then $y$ is a commutator of entries from $I$, so $y\in I$; because $J\trianglelefteq\mathfrak g$, we have $[x,y]\in J=\gamma_1(J)$, which is the desired conclusion for $s=1$.
If instead $x\in I$, then $y$ has $s$ entries from $J$ and $r-1$ entries from $I$. By induction, $y\in\gamma_s(J)$. Since $J\trianglelefteq\mathfrak g$, the same Jacobi-identity induction used above shows that every lower central term $\gamma_s(J)$ is an ideal of $\mathfrak g$. Therefore
\begin{align*}
[x,y]\in[\mathfrak g,\gamma_s(J)]\subseteq\gamma_s(J).
\end{align*}
Thus $C_{r,s}\subseteq\gamma_s(J)$ whenever $s>0$.
[/proof][/step]