A woman candidate has won the by-election unopposed on Sunday after three of her male contestants had withdrawn from the race.