This was the third meeting between Modi and Oli this year. They met earlier during Oli's visit to India in April and the subsequent visit of Prime Minister Modi to Nepal in May.
"Our deliberations were wide-ranging, covering multiple aspects of India-Nepal relations," Prime Minister Modi said after the meeting on the sidelines of the 4th BIMSTEC Summit here.
"We discussed ways to further deepen our economic, trade and cultural ties. Enhancing connectivity between our nations was discussed as well," he added.
Ministry of External Affairs spokesperson Raveesh Kumar said that the two leaders held a detailed review on all aspects of the bilateral relationship.
They had a "warm meeting", Kumar added.
"Following the talks, PM @narendramodi and PM of Nepal K.P. Sharma Oli witnessed the exchange of an MoU between the Government of India & the Government of Nepal regarding preliminary engineering-cum-traffic survey of the broad gauge line between Raxaul (India) & Kathmandu (Nepal)," Kumar tweeted.
The MoU was signed by Secretary at the Ministry of Physical Planning and Works, Madhusudan Adhikari, from Nepali side and Manjiv Singh Puri from the Indian side.
The strategic railway link between Raxaul and Kathmandu will facilitate people-to-people contact and bulk movement of goods.
The development gains significance as it comes two years after China agreed to construct a strategic railway link with Nepal through Tibet with an apparent aim of reducing Kathmandu's dependence on India.
It also comes in the backdrop of recent Chinese linkages with Nepal as it took on building three highways to be completed by 2020. The two countries have recently also signed a transit treaty.
This agreement also comes years after a sense of mistrust had prevailed when certain sections in Nepal blamed India for the 135-day blockade in 2015 - 2016 that had crippled Nepal's economy.
There are three other railway projects in the pipeline -- New Jalpaiguri-Kakarbhitta, Nautanwa-Bhairahawa and Nepalgunj Road-Nepalgunj.
Earlier, Prime Minister Modi had a series of bilateral meetings, including discussions with his counterparts from Thailand and Bangladesh, on the sidelines of the 4th BIMSTEC Summit here.
He also held talks with presidents of Sri Lanka and Myanmar.
The Bay of Bengal Initiative for Multi-Sectoral Technical and Economic Cooperation (BIMSTEC) is a regional grouping comprising India, Bangladesh, Myanmar, Sri Lanka, Thailand, Bhutan and Nepal. The grouping accounts for 22 per cent of the global population, and has a combined gross domestic product of USD 2.8 trillion.