A lot of large organizations have a settled shape, Java on the server, JavaScript in the browser, and a front-end team somewhere in between, wondering how much of the middle it is allowed to own. I have spent most of my career on the front-end side of that shape, and have a specific view of where Node.js fits.
Own the layer closest to the browser
I think Node.js has one clear job in a Java organization, to own everything from the browser back to the first service boundary.
Server rendering. Modern front-end frameworks render on the server by default, in JavaScript, so the rendering process is a Node process. There is no reasonable way to render a React or Angular page from a Java service.
Build tooling. Bundling, type checking, linting, and testing are a Node toolchain that already runs in every front-end engineer's editor.
The layer that shapes services for pages. A page typically needs data from several Java services, in a shape none of them returns. I think that shaping belongs in a thin Node layer the front-end team owns, often called a backend for frontend, because the people who know what the page needs built it.
Where it earns its place
The argument for this layer is about ownership, not technology. When the front-end team owns the layer that feeds its pages, a change to a page is one team's work from start to finish. Otherwise every page change becomes a negotiation between two teams with two backlogs, and the front end spends its time waiting.
The second argument is that the layer is small. It aggregates, reshapes, caches a little, and handles the session. It holds no business rules, which makes it something a front-end team can own well.
Where I would not take it
I would not use Node to rewrite the Java services. The services hold the business logic, the data access, the integrations, and years of knowledge about the business. Java is good at that job. A front-end team that reimplements a service in Node has taken on a job it is not staffed for, in exchange for avoiding a conversation.
I would also keep business rules out of the Node layer. The moment a rule lives between the browser and the services, there are two places it can be, and eventually it is in both, differently.
The line
So Node.js owns rendering, tooling, and the shaping of services into pages. Java owns the services. The front-end team owns its side completely, and the boundary is an interface both teams agree on and neither crosses.
I think both sides are happier with that line. The front end stops waiting. The Java teams stop fielding requests to add a field for one page. And the organization gets a front-end team that can ship on its own, which is what it wanted when it hired one.
Photo source: https://photos.robertstowe.com/wieliczka-salt-mine
