The Senate on Tuesday agreed to take up a measure that would force President Trump to end the war in Iran or win authorization from Congress to continue it, after a handful of Republicans joined Democrats in pushing forward with a resolution the G.O.P. has managed to block for months.