The Safe Third Country Agreement applies only at the Port of Entry to persons applying to enter Canada from the USA.

It does not apply to those who have already entered Canada legally or illegally.

And per s. 133 of the Immigration and Refugee Protection Act prosecutions and enforcement proceedings may not be taken against refugees who entered Canada illegally which is in accordance with the international conventions and treaties on refugees to which Canada is a signatory.