I'm a German living in Canada for almost 12 years now. I'm working here, never went to school in Canada, so my situation is a bit different.
My general view is that the overall costs of living are very similar. The big difference is in housing. Buying and financing a house or condo in Canada is way cheaper than in Germany if you live outside the hot markets of Toronto and Vancouver.
Renting is more expensive though, also it's easier to get evicted in Canada.
The price of energy - electricity (it's called hydro in canada), natural gas for heating, oil, gas/diesel for cars - is way cheaper than in Germany. My mother for example pays four (!!) times as much for natural gas than we do. A litre of gas/petrol is roughly CAD 1.00 in Ontario compared to € 1.25 (CAD 1.85) in Germany.
Groceries are in average more expensive in Canada. But then again - beef is cheaper and better, pork and chicken are more expensive. Overall, Germany has the lowest groceries prices in all of Europe due to very strong competition in the retail sector. There at least 3 countrywide (actually international) grocery chains which offer very lost cost food for decent quality. Alcohol is 2 to 5 more expensive in Canada then in Germany, but that's an avoidable expense for some.
If you own a house the property tax is five to ten times higher than in Germany. But you don't pay for waste management in Canada because that's included.
The list goes on and on.
Your individual situation might be completely different from the averages though.
I wouldn't focus too much on the cost of living. What's of overwhelming importance is something completely different.
It's starts with the question: In which country lives the future PhD student currently? What's her/his mother tongue? Is he/she member of a visible minority aka of African or Asian heritage?
If you don't speak German, if your skin is not pale then don't go to Germany. You'll be much more welcomed in Canada. In Germany it will be much harder to settle in. You'll never be a German even after 40 years of residence. If you only speak English then you might get by for your studies at the university. You will get around in the big cities like Berlin, Hamburg, Munich and Frankfurt. But don't expect anybody outside of those areas to be able to communicate well enough to order food or to ask for directions.
On the other side of the atlantic ocean you can become a Canadian in no time.
From a legal perspective: Canada is a country of immigrants (we've ignored the Native heritage of this country for centuries but this is - painfully slowly - changing). The entire society, laws, public services etc are geared towards immigrants. Canada is very immigration friendly. The immigrant is the norm not the exception.
Germany is a country full of immigrants. But Germany has not a coherent immigration law. The public opinion doesn't consider the country an "immigration country" despite the obvious facts. Most of the immigrants in Germany are from neighbouring countries - Switzerland, Austria, Poland, The Netherlands etc. Many of the non-european immigrants came through the asylum rules. Germany doesn't let people in because they can be a contribution to society but because they had the means to reach the borders of the country. The immigrant in Germany is a special case, she/he is the exception.
It's also more complicated to achieve permanent residence and later citizenship in Germany compared to Canada. The wait time is 5 years in Canada compared to 8 years in Germany as far as I remember.