In battleground states, President Donald Trump and former President Barack Obama presented sharply different messages about the state of the economy and the direction of political discourse.