I'd give them to the teacher if you were going to return them; whoever's they were they are probably in that class. But tbh ignore anyone trying to make you feel bad for snatching them, it's a pair of headphones, it's not a phone or something valuable. I could get it if you saw whose they were, but you didn't so its not likely they find their way back to the owner anyway.
The internet is great at throwing things out of proportion.