Further to what mom says provided... as I understand it, the ship arrives in Quebec on a Thursday and is in overnight. That means an earlyish departure on Friday morning ought not be a problem. The train station in Quebec is located close by the cruise port. The train station for Montreal airport (YUL) is located close to the airport (the stop is called Dorval, which is the municipality in which the airport is located). There is a free shuttle for Via Rail ticket holders from Dorval to YUL. I have attached a screen shot of a typical train itinerary for information.
This is a lot of fooling around to fly out of YUL instead of YQB... I'm sure there are good reasons!