President Lula has sought to maintain ties with the US, China and Russia. But even before the re-election of Donald Trump, that diplomatic space was shrinking