Only if those foreign governments are “enemies”. We are no longer in the Cold War, so I don’t think the Russian government would be classified as such legally. Now if it involved giving away secrets, espionage would work, regardless of whether they were enemies or allies.
I won’t push the issue but I don’t know if “enemy” has much legal definition. Heck, people argue over the legal definition of “Natural Born Citizen”. If treason were defined as assisting “foreign countries with which we are in a state of declared war” then I’d say no charges would stick. But if today were Dec 1 1941 and you were helping Imperial Japan gain knowledge of our situation in Hawaii, I’d say that was treason. But, you know, Pearl Harbor hadn’t happened yet, so maybe Japan wasn’t an “enemy” and maybe “treason” charges wouldn’t stick.