Amtrak officials on Wednesday provided the most detailed public account yet for the projected costs of building a new Hudson River rail tunnel and improving other critical parts of the rail infrastructure in the New York region.

The project, known as the Gateway program, has been championed by Anthony Foxx, the federal transportation secretary, who on Wednesday visited the deteriorating rail tunnel that runs between New York and New Jersey.

In a presentation to Mr. Foxx, Amtrak officials said the entire project could cost as much as $23.9 billion, with the largest share of about $7.7 billion going toward building the new Hudson tunnel and repairing the existing tunnel. The project includes a host of other elements, including expanding Pennsylvania Station in Manhattan at an estimated cost of $5.9 billion, and replacing rail bridges in New Jersey.

The project gained momentum last year after Mr. Foxx raised concerns about the existing century-old tunnel, which has two tubes and needs repairs because of damage from Hurricane Sandy. After a contentious debate over how to pay for the tunnel project, federal and state officials agreed to split the costs and to create a corporation within the Port Authority of New York and New Jersey to oversee the plans.