Whatever it is, it's both consistent and plausible.
1) Surely the 24th century would have come up with a means to remove stains from flat surfaces, and others. There's both a demand and no doubt an abundance of means.
2) Indeed, we hear this has happened: Riker says the ship cleans itself.
3) And we see this happen, and hints at how it happens: stains of all sort appear, but then change shape, and ultimately disappear.
Trained bacteria sound like a realistic solution from today's vantage point. But 24th century is way beyond realism and entitled to other solutions - just like the real 20th century was way beyond realism from preceding vantage points, and entitled to solving ages-old problems of communications, computation, commuting or combat with all sorts of apparent dark magic.
Timo Saloniemi