The men were charged with engaging in conduct likely to assist a foreign intelligence service, police said.