If you intended to compute $m-l$, as the code fragment suggests, then do
{a,b}::Indices;
l:=k_{a}p_{a};
m:=k_{b}p_{b};
ex:= @(m) - @(l);
rename_dummies(_);
The last line is necessary because the dummy index name is not the same in the two terms ($a$ in the first and $b$ in the second). In order for rename_dummies
to work, it needs to know that these indices sit in the same set, which is what the first line declares.