Exchange Online lacks Where-Object because people tend to abuse it ;). In a case like this, you’d be engaging some serious processing power if you had a lot of mailboxes, and Microsoft doesn’t want their servers bogged down like that.
You’re probably going to have to get a list of mailboxes, bring that over to your local computer, and then enumerate them. For each mailbox, you’ll have to get its permissions and store that information locally.
This gets easier if, instead of using Invoke-Command to run the commands, you implicitly remote the commands. That gives you deserialized objects on your computer - meaning you could run Where-Object, but the processing for that would happen locally, not remotely, so it’d work. So you’d start with your connection to Exchange as a PSSession, and then use Import-Module with that PSSession to bring the server module over to your computer (it doesn’t actually copy the module).