In principle, EU law applies to sellers in the EU. However, you need to check what the law actually says. First, it applies to sellers, not manufacturers. And it may be a requirement that you return the broken goods to a branch of the seller inside the EU, so they may not be required to do anything about a product somewhere in Los Angeles for example.
On the positive side, your statutory rights apply if the goods don't work for a "reasonable time" (which may or may not be two years), but your rights run out several years later. So if you have evidence from the US that the item was broken after 18 months, and you travel to the EU one year later, they'd have to fix it. Because it was broken within two years.