I'm not voting on the poll as I can't really say whether which option is the correct one, to be honest. I can't say whether your district would view even a comment such as that as inappropriate if they found out, it seems that they all treat things like this differently.
I know that once me and my peers were moving onto middle school they were all asking their favourite teachers if they could add them to keep up with how they're doing, and this specific teacher said she only would if they were the age to be on there (we were only eleven/twelve) and their parents were okay with it. So obviously there was no issue with that in my district and the teachers were very responsible about it. I even saw teachers comment on students things once in awhile after that.
But, personally, I think if the mother has added you on Facebook and trusts you enough to do that it would be fine to express condolences about the cat. I think her and the family would appreciate that, and it's something that would be very hard to be taken out of context. Also, what you said in your original post is probably good enough, as it's somewhat impersonal (I mean that as in it still upholds that professional relationship with them).
If you're still worried, you also really don't have say anything. The mother probably doesn't expect everyone to respond to her post anyways, and wouldn't think twice about her sons teacher not doing so. I assume you added each other with the expectation that you'll just see her posts, which would make it even more okay to not say anything.