A depressed and demoralized Democratic Party is beginning the painful slog into a largely powerless future, as its leaders grapple with how deeply they underestimated Donald J. Trump’s resurgent hold on the US nation.