The lawsuit filed Wednesday asks a judge to declare the firings unlawful and restore the inspectors general to their positions at the agencies.