Depends upon the circumstances, and the agencies involved.
If we're talking about the FBI, then sure -- the FBI does questionably legal things (or outright illegal things) all the time, and suit can be brought against them (though if you're fighting a civil suit against a state actor, good luck paying for good enough legal defense to win even a case that should theoretically be open-and-shut in your favor). But, the FBI doesn't develop their own software in-house.
If you're filing a suit against the NSA or the CIA -- in other words, agencies operating with classified materials -- you can run up against a lot of (potentially artificial) roadblocks relating to classified materials. The agency can claim that they have some classified material that exonerates them, without revealing it in camera; they can throw out the content of leaks by claiming that (because it is technically classified) it cannot be entered into evidence. These tactics work more often than you would reasonably expect -- sometimes both in the course of the same case. And then there's all the (theoretically illegal) things they can do to you in order to discourage you from bringing suit in the first case.
The legal system is essentially a mechanism for making decisions based on overhearing arguments between human beings. In other words, it is and always will be a mess.
There's also the problem that software licenses are rarely upheld in court (and often contain clauses that have been ruled against). Just because a license says something doesn't mean that it's true or meaningful -- for instance, the warranty invalidation clauses in EULAs are not legally binding (and if you violate one you still can demand warranty protection/service in many cases, although you will probably need to go to court to get the company to aggree).