Wow, that's a tough call. I've lived in the DC area and you're right, the cost of living is outrageous. A few questions:
How old are the kids?
Are you eligible for any income-qualified rental communities?
Are you working too?
Why do you have a two-year window to stay in DC before leaving for somewhere better? Can you leave sooner?
Is public transit an option, allowing you to live farther from your husband's work but allowing him an inexpensive commute?
Would an apartment be less expensive than a townhouse? Either way, you've got 2 bedrooms so I can't imagine the living space is dramatically different in size.
I don't know that it is realistic to plan on staying with family if your husband is out of town and you feel unsafe. In my experience, feeling/ being unsafe tends to happen fairly spontaneously and with little warning. Unless you plan on leaving every time your husband travels, this is probably not a realistic plan.