'Anti-Mears' vote triumphs in by-election