“Till the Indian elections, there cannot be an immediate betterment in bilateral relations,” Mr. Chaudhry said. India’s military and its foreign ministry did not respond to requests for comment.

The new Pakistani government led by Prime Minister Imran Khan has been sending strong signals in favor of talks, though it is the military that ultimately controls foreign and defense policy. “If you take one step forward, we will take two steps forward,” Mr. Khan said in his victory speech, addressing India. “We need to move ahead.”

With Mr. Khan in office, talks may have a better chance because he is seen as the army’s man, diplomats in both Islamabad and New Delhi say. India sees Mr. Khan’s outreach as sanctioned by the military and believes he will clearly present General Bajwa’s demands and red lines.

That the military would initiate such a major foreign policy decision unilaterally, and before the elections, suggests it was confident that its preferred candidate, Mr. Khan, would win. Mr. Khan was sworn in as prime minister last month, in the wake of accusations that the army had intervened to back his candidacy.

Diplomats in Islamabad say Pakistan’s outreach may also be driven in part by the country’s Chinese allies. Beijing has prodded Pakistan to stabilize its border with India, hoping for greater stability as it pursues its regional economic ambitions. China is investing some $62 billion in Pakistan, mostly in large infrastructure projects through what is being called the China-Pakistan Economic Corridor, part of China’s global Belt and Road initiative.