Carry a bottle of non-aerosol air freshener with you to church next time. As soon as the flatulently-challenged party expels the disagreeable odor, aim and spray a fine mist. Then apply a clothespin to your nose and offer additional clothespins to the other parishioners.
heehee I'm absolutely joking, my friend.
Seriously though, if it's somebody you are certain knows better and is just being discourteous, tell them in confidence and with grace how it bothers you terribly.
This reminds me of an elderly lady who used to sit in the back of our church years ago because she had a problem with flatulence. She was always joyful, always sang to the Lord with her whole heart, was sweet and kind to everyone, but nobody ever sat next to her because of the foul odor.
I was one who wouldn't sit near her because the smell was extremely terrible. But I finally realized my attitude stunk worse than her bodily aroma and I chose to sit next to her. How happy she was that I did! Of course, there was no denying the air around her was enough to make your hair stand on end, but the joy on her face and her sweet graciousness toward me made me get over myself. I can't stand the thought of myself every time I remember how I avoided her. I'm so grateful to the Lord for making me be nice to her. She didn't live very long after that.