I've been in this situation before, and can commiserate.
For me, I basically decided that if the players couldn't be bothered to be engaged, that I couldn't be bothered to participate. If the group was to continue, that change was needed.
I can be pretty blunt when the situation suits. I really, really hate lack of transparency and disingenuousness when I interact with people. When I detect those things, my psychological makeup simply won't tolerate it, and at that point I have very little fear of calling out the "elephants in the room," so to speak.
"So, I'm going to be honest, the current dynamic of the group isn't working for me. There's a lack of engagement, and it doesn't feel like we're collectively getting what we want out of this.
"I want this to change, because all of our time is valuable. If you're only coming to these sessions out of a sense of obligation, that's not going to work. Obviously engagement will vary over time, it's not like I'm expecting you come to every session like it's a World Cup soccer match. But overall, there's a general level of engagement that's needed for this activity to really succeed and be what we want it to be.
"And look, if this really isn't your cup of tea, that's okay! No one's going to be offended if you leave, or decide to spend your time in other ways. It's your life. The number of hours in a day and week are limited.
"So --- what do we really want?"
And then really talk about it. Is it system? Is it the types of content being presented to them as the GM? Is it pacing? Lack of combat? Too much combat? They want more mystery? More player control? More narrative driven?
And the thing of it is, seeing how they react to this kind of conversation is just as much a litmus test as what they actually say. If they perk up and become engaged in talking through these things, then you know your group has a chance. If the conversation is little more than some hemming and hawing and a few vague generalities, then you know that it's probably time to move on. If they can't even bother to talk about what they'd like out of their RPG play, then you know it's not important enough for them to even care about what they care about.
The other thing about having this kind of a conversation is, you have to be fully willing to accept ANY outcome. It's entirely possible your group will get a new lease on life.
It's also entirely possible that the group will disband, or you'll end up walking away---which is what I ended up doing, and I have zero regrets to this day about doing so.
But choosing to NOT hold this conversation generally leads to the group disbanding anyway, but after a protracted stint of unenjoyable, unsatisfying gaming. So why not just skip the unenjoyable, unsatisfying gaming and get right to the result, good or bad?