SNP leads Labour by just two points after heavy by-election loss