Definitely don't end the relationship if it can be salvaged. Keeping the relationship is what is best for your nephews, and hopefully your brother is mature enough to understand that. It's much better for the kids if they feel that the people they love all get along adequately.
What you do depends on how often you see her. Keep her on your holiday card list, stay Facebook friends, etc. Once the divorce stuff blows over, you can be in a little more contact. But keep things light. If divorce issues come up, say it's better that the two of you not talk about it. Tell her you value her friendship, think she is a great mom, whatever nice things you can come up with, and say you are glad you can stay in touch despite the divorce.