The agreement emerged at the end of talks in New Delhi between Prime Minister Narendra Modi and his Nepali counterpart KP Sharma Oli, making his first foreign visit to India after returning to power earlier this year.
During his earlier tenure, Mr Oli sealed deals with Beijing in 2016 to use Chinese roads and ports, seeking to reduce Nepal's dependence on India for trade and transit.
The planned railway line from the border town of Raxaul to Kathmandu would be the mountainous nation's most ambitious railway project. Nepal currently only has rail links on its southern plains.
"As a first step...India would carry out preparatory survey work within one year," a joint statement after the talks said, to finalise the details of the line.
Analysts said the latest Indian move was spurred by China's expansive infrastructure projects in Nepal as both Asian giants jostle for influence.
The plan to develop inland waterways will give Nepali cargo additional access to sea and boost its trade, officials said.
Follow NDTV for latest election news and live coverage of assembly elections 2019 in Maharashtra and Haryana.
Subscribe to our YouTube channel, like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.