A visa does not normally extend beyond the expiration date of the passport.
You can renew your child's passport in Canada. There is a long list of required documents on this page of the Embassy of Pakistan in Toronto. I'm not going to reproduce it here. I suspect that you can not use the online passport renewal application.
Once you have the new passport, you will have to apply for a new visa for your child.
I assume that the child has a TRV (Temporary Residence Visa). You can request to extend / renew / obtain a new one in Canada. This page discusses the length of the stay using a paper form. It is possible to apply online, but it may be useful to read this page. Highlights include:
- Apply at least 30 days before TRV expires, but current processing times approach 60 days, check
- Each dependent must apply separately