Two competitive by-elections are under way as parties seek momentum in contests with national political significance