Are the government grants included in the calculation of the $50,000 lifetime contribution limit to an RESP?

No, the lifetime contribution limit of $50,000 excludes all government grants as well
as the distributions and income earned on the investments in the plan.