TORONTO — Bowing to pressure from opponents and allies alike,Mr. Justin Trudeau — whose championing of progressive politics rocketed him into the international spotlight as Canada’s prime minister but who has faced growing headwinds at home — announced that he intends to resign as Liberal leader, making way for a new prime minister.