When you deplane at YUL you will be steered directly to Canada immigration & customs. There's no means to remain in the gate area.
You'll then be punted out into the airport and will have to wait until US CBP opens so you can make your way back to your gate.