I think that was more of anti-Hillary vote than pro-Trump. 2016 clearly shook things up a bit, and we might see trends that it amplified continue for quite some time, but we can't draw EVERY conclusion from one election. Maine is still a New England state with largely New England politics, even if more moderate than the likes of Massachusetts. 2016 had a particularly weak Republican field, but I think Generic R™ beats Hillary Clinton in ME-2 in the environment of 2016.
I wouldn't call it anti-Hillary. The 2nd has a very independent, working-class streak to it that Trump especially appealed to. If it was anti-Hillary, then the 1st, with Portland (Bernieville), would have been closer, but it was about average as to how it usually goes.