The longest-serving Senate leader is relinquishing his post in the next Congress and planning to use his influence in ways that could put him at odds with President-elect Donald J. Trump.