My mom's passport will be expired on 28 however she has ticket to back to Iran on 27 from Toronto via Frankfurt. She has permanent residence card but she is not Canadian citizen, therefore the only passport she has is the Iranian one. When she changes the flight in Frankfurt, her passport will be expired. Can she travel in this situation?
If the trip is one booking (meaning, she doesn't need to clear immigration to pick up luggage) the passport requirements for entering Germany do not apply to her (she also needs no visa as she has a Canadian PR card), and only the entry requirements for Iran are relevant.
And as stated by Timatic, the database used by airlines:
Nationals of Iran are allowed to enter with an expired passport.
So yes, she can travel without problems