Over the last decade, they have not gotten anywhere near the kind of capital funding enjoyed by sports teams.

From the 2006 fiscal year through 2014, the city budgeted at least $464 million to build new baseball stadiums for the Yankees and the Mets, and $156 million for the Barclays Center. That’s $620 million for just those three sports arenas — a sum more than one-third greater than the $453 million that the city committed for capital improvements to the its 206 branch libraries and four research centers, which serve roughly seven times as many people a year as attend baseball games. (The budget figures were provided by the city’s Independent Budget Office; the teams are getting an additional $680 million in subsidies spread over 40 years.)

For decades, the libraries have served a single function in the city budget process: hostages. Mayors say they have to cut library hours to make the financial books balance. The City Council rises up in outrage. During the negotiations, hours are ultimately restored, usually swapped for something else that the mayor actually wants.

Despite these annual rescues, library hours in New York “trail behind cities throughout the nation,” according to a study by David Giles published this month by the Center for an Urban Future.

Now the libraries are on a campaign for more money to build or rebuild branches that are run down, although some people suggest we don’t need libraries now that all the information in the world can be gotten on smartphones.

“Our research suggests that this couldn’t be further from the truth,” Mr. Giles wrote in a 2013 study, “Branches of Opportunity.” The report documented increases in attendance that would be the envy of any sports teams. The branches, it said, “are a key component of the city’s human capital system.”

That has been their historic role in New York.

One day in 1933, a 12-year-old boy named Joseph Papirofsky, a son in a house of immigrants where only Yiddish was spoken, arrived at a public library in Williamsburg, Brooklyn. He browsed the drama shelf.