I completely reject your fatalistic line of thinking on a few grounds:

1. You can totally win, provided that you show up with thousands of your friends and a desire to wreck shit. See the corpse of STASI, which the Western surveillance apparatus has surpassed in every dimension: https://en.wikipedia.org/wiki/Stasi#Storming_the_Stasi_headq... (especially read the part about the headquarters being stormed and unconfirmed reports of lynchings-- sounds a lot like they lost on a permanent basis) The KGB office in Berlin met a similar fate (it was supposed to be clandestine, but oops-- intelligence agency installations are seldom hard to find because they rely on being hidden in plain sight), however most of the files contained within were destroyed thanks to the quick thinking of an officer there-- Vladimir Putin.

Another example of total victory is the ugly rout of South African intelligence agencies at the very end of apartheid-- quick, gory, and intentionally forgotten during the "truth and reconciliation" period. These agencies had a premium on brutality, and they aren't nearly as well known as the CIA or Mossad. Interestingly, there were actually several intelligence agencies of SA at the time-- the military intelligence organization was hit the hardest, but responded by digging in and doubling down on brutality. The other (which has had its name changed a number of times but was at the time known as the National Intelligence Service) was horrified by the military intel agency being hunted and killed, and changed focus to clandestinely work on a truce.

2. You can partially win by forcing them away from your area, provided that you have access to the political apparatus. There was an article trending on HN today about how Bolivia had forced out the DEA. Sure, maybe you can argue the DEA isn't the CIA or Mossad, but the point is clear: these organizations can't operate with impunity if the (quasi stable) political apparatus decides to resist them. An alternative set of examples here are Iraq/Afghanistan/Pakistan/Kurdistan/Syria-- both the CIA and Mossad (and likely Shin Bet) chalked big losses here (with heavy loss of life of their own personnel as well as countless indigenous assets) because the population was hostile to them. Collecting HUMINT requires willing humans, and torturing people doesn't cause that. It's also extremely hard to blackmail or bribe a tribesman.

3. You can buy them out or co-opt them, if you have the right connections. It's no secret that Putin rose to power via the KGB's influence, but during the transformative 90s, Russia's economic power was privatized and separated from the government's apparatus creating a plurality of power loci. Following this, there began a curious phenomena (replicated by corollaries in the US around the same time) of the Russian intelligence agencies being caught willy nilly for industrial espionage. In the midst of economic strife and violent internal insurgency in the Muslim territories around the same time period, the intelligence agencies of Russia were largely busy chasing dollars rather than mujaheddin. Why? Because the newly minted oligarchs were more concerned with making more cash. This is currently happening in the US. The takeaway point here is that a change in focus can count as a win.

4. You can change their political mandate with reforms. The US has done this once already with the CIA, and will likely do this many more times. There are too many examples of this to list.