Yes you can,
If you have a single entry visa and you decide not to going outside,of course you can and still use your single entry visa for transit.
Also in this way your visa will be stamped as used and will be no longer valid.
But I dont no the immigration system in montreal,but if there is a transit area where you dont have to pass immigration and you are just going to your new gate,then nobody really knows that you are in except for your connecting flight.
Fact is if you have to clear immigration It doesent matter which visa you use it will be stamped as used.
Cheers.