It turns out this is an issue with any game that runs on the client though -- regardless of if you're using Firebase or not. Preventing cheating is tough because at some step in the process here you're relying on the client to tell the server the truth. Since the game runs on the client, you can't ensure that the code hasn't been tampered with, or that an AI isn't playing the game, or that the user hasn't cheated is some other way.
With Firebase security rules, you can enforce that only that user can set the score, and you can enforce that the score is of a valid format, but fundamentally there's no way to ensure that the score is "real".
afaict (would loved to be proven wrong here) Firebase gives you basic protection but any script kiddie will still be able to defeat it.
Edit: grammar
Ie most multiplayer games ship the same physics code on client and server, but the server is the authority.
That kind of game is clearly impossible with Firebase, but depending on the expressiveness of the validations, there might be ways to prevent cheating.
allow update of y_pos IF jump.pressed
AND not jump.wasPressed
AND new.y_pos - old.y_pos < 3
AND old.was_on_top_of geospatial( world_geometry, entities)
AND new.not_inside geospatial( world_geometry, entities)