The difference between getting caught and not is the follow-up events. Getting caught will have more or less serious consequences. Not getting caught will literally have no effect, not to you, not to the "victim".
And just for the record, I can remember that when I was a teen, I once accidentally entered the girls´ lockerroom, because the changing rooms were always confusingly distributed at our school. I turned around and walked away, the end. No police, lol.