I've been considering this again, especially in light of the Sun stating that Trump has repeated the claims that a trade deal may not be possible if we opt to remain in the EU and just pretend we've left. I think there are two points; dealing with the minor one first.
Expectation. Obama was expected to be diplomatic to a friend and had no justification in claiming that he'd not be looking at a trade deal with us. It can only have been to try to manipulate the public to vote remain. His actions went against our decent expectations of him. Trump, on the other hand, is known for saying anything he thinks will benefit him and hang the consequences to others. That was our expectation of him, and "he didn't disappoint".
But there is a second related and more significant reason for a difference. As mentioned above, there was no legitimate reason for Obama to say anything. Trump, on the other hand, has spoken of a trade deal once we get out of the EU, as we voted for. If we go with this 'it says out but we're still in really' plot of May's, then the situation has been fundamentally changed. Trump's not going to want to be called a liar should we not get out and he then has to withdraw any trade offer, so it's important he points out that if one side doesn't do as they claimed, the agreements discussed, based on that false claim, can not be obligatory on the other side.
I'd rather neither said anything, but one can understand why Trump felt there was a need to.