A $400,000 federal grant could lead to improving the Metro-North Danbury and New Canaan branch lines and even extend rail service to Brookfield and New Milford.

The grant will go toward a regional study that will evaluate previous recommendations for the lines and develop a plan to pay for and implement them.

“Recommended improvements to the Danbury Branch Line, especially expanding passenger rail service back into New Milford and Brookfield, will be catalysts to economic growth,” the U.S. Department of Transportation said when it announced the grant Wednesday.

Officials have long discussed returning rail service to New Milford, which last had a passenger train in 1971.

A $1 million study is looking into opening an old rail line by the Danbury Fair Mall to connect the Danbury line to the Harlem line, creating a faster ride to New York City.

The latest funding is part of $1 billion the Trump administration announced Wednesday for infrastructure projects nationwide through the Better Utilizing Investments to Leverage Development—or BUILD—Transportation Discretionary Grants program.

The idea of the study is to make the rail lines safer and more attractive to commuters, as well as determine whether a mechanism can be used on a regional, multi-jurisdictional level to generate the money needed to support the improvements, the U.S. Department of Transportation said.