House Speaker has faced internal revolt while trying to steer his razor-thin majority in the direction of passing legislation aligned with Trump’s agenda