Labour’s victory ends a miserable time on the political sidelines as the Conservatives imposed years of austerity and engineered Brexit.