The Liberal Democrats have held their seat in Dodworth in a by-election triggered by a councillor’s resignation.