"Longer" I'm sure you realize is a comparative adjective which means that you are comparing it to some shorter term. The phrase "in the long term" implies "over a long period of time". Example: In the long term, all things come to those who wait. Sooner or later, all things come.... In the end, all things come... Eventually, all things come....
In a comparative sense, one might say, "Spanish seems easy at first, but, in the longer term, it gets harder.
I hope that helps.