LOL! I love the way you handled it!!!
The exact same thing happened to my 10 year old granddaughter this summer. We were at my aunt's funeral. When we got to the church, she and I went to the ladies room. After we came out, we were walking down the hall. The minister was walking behind us, and he said,
"Ah-hem, ladies" We turned around and he said, very quietly, to my granddaughter, "Uh, uh, your dress is hiked up". She turned around and when she did, I could see her dress was in her panties. She was mortified - she mooned the preacher!!! LOL!
She was a very good sport about it and was laughing too, in a few minutes!