LIMIT affects the number of rows returned. SUM only returns 1 row, so limit will have little affect on it.
If your where clause is using a list of unique ids you could limit the number of ids being included in the query.
$sql = 'SELECT SUM(ie), SUM(ge) FROM caja WHERE id IN(' . implode(',', array_slice($array, 0, $tot)) . ')';
Otherwise you might be able to do it with a temporary table, but that's probably more effort than it's worth. Unless the number of rows you're trying to sum up is huge I'd just retrieve the data (with LIMIT) and do the sum myself at that point.