The route from Munabao in India to the southern Pakistani town of Khokhrapar was suspended in September 1965 when the two countries went to war over the disputed Himalayan territory of Kashmir.
"Both sides agreed to an early resumption of the rail link between Khokhrapar and Munabao," Indian and Pakistani railway officials said in a joint statement on Friday after two days of talks in Islamabad.
The railroad, which could take up to two years to resume service, is part of a slow-moving peace process between the neighbours, who have fought three wars since independence from Britain in 1947.
In January a train service resumed between Pakistan's second largest city Lahore and the Indian border town of Atari following a two-year break, also caused by tensions over Kashmir.
No commercial value
The second rail link, just 10km long, will have no commercial value but is mainly aimed at reuniting divided families in Pakistan and India and improving bilateral relations, officials said.
The second rail link is aimed at
reuniting divided families
The two sides agreed to take steps "to undertake specific activities including laying of railway track and other related infrastructure to operationalise the rail link", the statement said.
They would hold a further meeting at a mutually agreed date, it said, adding the talks were "cordial and constructive".
The negotiations were led by Pakistan railway board secretary Zaeem Chaudhry and Indian railway ministry official LR Thapar.
Chaudhry on Thursday said the railway link offered no financial benefits but was "just a good gesture ... a sort of a gift from one country to another to bring the divided families together".
Pakistani officials said India had proposed reopening the route by October next year, but the timeframe is regarded in some quarters as unlikely.
Pakistan will have to replace its narrow gauge 128km track from Mirpur Khas in southern Sindh province to the Khohkrapar border by laying a broad gauge track to meet modern rail requirements.
It may take one to two years to
make the system operational
The actual track between Khokhrapar and Munabo, which is in India's Rajasthan state, also needs rehabilitation, they said.
It may take one to two years to make the system operational, local media said, adding the project would cost INR 2.10 billion ($35 million).
Indian and Pakistani officials have since January been discussing various major sticking points and ways of building confidence.
Kashmir has sparked two of the three wars between India and Pakistan. In 2002 a tense stand-off in the region caused fears of a nuclear conflict before the two sides pulled back their troops.
But in April 2003 then-Indian prime minister Atal Behari Vajpayee started the current peace process by offering a "hand of friendship" to Pakistan.