The Labour party is bracing for another difficult by-election this summer if Tracy Brabin, MP for Batley and Spen, is elected as the first West Yorkshire mayor on Thursday.

The 59-year-old former actress was first elected to parliament following the death of Jo Cox during the 2016 Brexit referendum campaign. Brabin was selected in December as the party’s candidate for the West Yorkshire mayoralty, which includes the cities of Wakefield and Leeds.

Batley and Spen was a target for the Conservative party in the 2019 election, but Brabin held the seat with a reduced majority of 3,525. Officials in both parties are preparing for a similar battle to Hartlepool, which pollsters predict could return its first ever Tory MP following a by-election on Thursday.

Unlike other mayoralties in England, the West Yorkshire role will combine political responsibilities with the police and crime commissioner job for the area. Luke Hall, local government minister, told MPs in January that the police powers would be handed to the new mayor in 2021.

According to the Electoral Commission, the body that oversees UK elections, any individual with police and crime commissioner responsibilities must stand down as an MP before taking up the role.

Brabin confirmed to the Financial Times that she would stand down immediately as an MP if elected as West Yorkshire mayor. The result from the West Yorkshire mayoralty race is expected to be declared on Sunday.

The date of the by-election would be determined by the Labour party, which may wish to push it as far into the future as possible.

Barry Sheerman, MP for nearby Huddersfield, said: “A lot of people took a long time to wake up to the fact that the West Yorkshire mayor will have police powers, meaning Tracy will have to resign quite promptly.

“We are aware of that and it will be a challenging by-election, as by-elections always are. I think the party is aware of that, but I think as long as we get the right candidate it is winnable.”

One well-placed Labour party figure said the party was lining up Lisa Johnson, director of external relations at the GMB trade union, and Fazila Aswat, the office manager who was with Cox when she was murdered, as likely candidates for the seat.

In the 2019 election, Paul Halloran, an independent candidate who stood in Batley and Spen, took 6,432 votes — standing on a platform of a “clean Brexit”, a reduction in foreign aid and a tough stance on law and order. One local Tory activist noted “much of it is similar to our platform”.

Conservative campaigners think that if Halloran’s votes can be taken by the Tories, along with some from the Brexit party, they might have a chance of winning. But the constituency also has a higher than national average ethnic minority population, which has historically benefited Labour.

Senior Labour figures are aware of the potential for another loss in Batley and Spen although they hope it will be more defendable than Hartlepool. “The election joy never ends,” said one senior shadow minister. “It wouldn’t be as much of a nightmare as Hartlepool . . . on paper,” said one aide.

One senior Conservative MP also cautioned that Batley and Spen is “a different world” from Hartlepool and would by no means be an easy win for the party.

But another shadow minister warned of tensions ahead if Labour were to lose in Hartlepool and in the mayoral race for the West Midlands. “Unity won’t last long . . . if he [Starmer] doesn’t buck his ideas up we will do worse at the next election. We can’t let that happen.”

One analyst said that there was a tiny Brexit party vote in Batley and Spen so the result would depend on the Labour to Conservative “defection rate”. “Labour’s best policy is to play for time given the vaccine sugar high for the government in polls probably falls off come the autumn,” he said.