The twin challenges represent a sobering situation for a president who has reveled in his unrivaled dominance in Washington.