The by-elections were necessitated after the incumbent legislators were elected to the Lok Sabha