A former military chief is seeking to unseat Israel’s prime minister in a race too close to call.