The script makes it clear that Qui-Gon and Obi-Wan both knew (or at least very strongly suspected):
PADME: I am Queen Amidala.
JAR JAR and ANAKIN are stunned.
PADME: (points to Queen) This is my decoy... my protection... my loyal bodyguard.
OBI-WAN and QUI-GON give each other a knowing look.
The Terry Brooks novelisation gives an indication of precisely when Qui-Gon Jinn first began to suspect that something was amiss;
Queen Amidala leaned forward, and a slender white hand came out to
touch the droid's domed casing. "Thank you Artoo-Detoo. You have
proven both loyal and brave." She glanced over her shoulder. "Padme."
One of her handmaidens came forward. Qui-gon Jinn, listening to the
exchange with half an ear as he considered the problems that lay ahead
on Tatooine, noticed that it was the young woman who had supported
the Queen's decision to escape from Naboo. He frowned. Except, it
hadn't been exactly like that . . .
"See to the cleaning up of this little droid." The Queen was speaking
to the girl. "Artoo-Detoo deserves our gratitude." She turned back to
Panaka. "Please continue with your report Captain."