A US federal judge had sided with Congress in its battle to obtain US President Donald Trump's financial records.