Well, I probably have a whopper of a bias here called a Master of Library and Information Science (MLIS) degree, though I moved from a public library to corporate IT around the time my son was born and he's now married so, yeah, been a while.
First off, there's still plenty of demand for paper books from what I hear, so the traditional library ain't done yet, probably not until my generation (Gen X) is gone. Most libraries now provide access to e-books through services like OverDrive and there's even movement towards sharing those electronic resources (I can access e-books for half a dozen Ontario libraries on My Libby, the OverDrive app, all using my card with my local library). In the long haul, yeah, I imagine you'll just have the Ontario Library Service (the coordinating and supporting body for public libraries here) providing electronic resources to the whole province.
The library's role as an information centre has changed dramatically, from actually answering questions and helping people navigate complex paper sources to mostly as a provider of online resources and knowledge of how to use them. That actually started when I was in library school but at that time, the resources were all commercial databases so the library was the only place most people outside of academia and major corporations could get access to them. Now, so much is readily available online, but the library still provides access, usually via an authenticated section of their website, to things like full-text magazine indices and magazine apps so that people can get access to material tht is otherwise locked up behind paywalls and subscriptions. Again, though, does this require a local library or could a broader entity like a provincial/state library service provide those?
The third role a lot of public libraries play right now is local community centres. They run, or host, various programs, act as "cooling centres" and "warming centres" during weather warnings, provide free or low-cost Internet access to the homeless or poor, and do still assist people in finding information, even if that is often teaching them how to better use the Internet rather than searching through paper resource and commercial databases. And the human touch is needed for all these roles.
So I see benefit to centralizing electronic libraries for sure. But I think the local library still has a role to play if the librarians are willing to step up and play it rather than hunkering down among their books. And I do see libraries around here walking that walk. When I was still working as a librarian, an alliance of libraries in the area where I worked led an effort to get a local Freenet started to provide free and at-cost Internet access to people who couldn't afford commercial services, as well as developing plans for electronic resource sharing. And that was in the late 90s (I switched jobs in '99).
As I said, I have a clear bias here though I left the library world over twenty years ago, but I do see libraries that are making a serious effort to define a role for themselves in the 21st century. Whether they succeed depends a lot on public support, since the funding mostly comes from political entities who tend to listen to votes and polls, not librarians.