Bear in mind the US and China are currently engaged in an espionage war[1]. The US has an active network of informants in the Chinese government, while the Chinese are actively conducting espionage and counter-espionage in the US including stealing commercial secrets and suborning US intelligence operatives to undermine the CIA's Chinese network. Google and Huawei are being caught in a crush between the spy war and the trade war.
EU companies are no different. If Google was a German company and Germany decided to impose trade sanctions on a non-EU country, they would have to comply.