In the long run means not immediately, but at a time in the future.

I know it involves putting in more effort now, but I think it’s the best solution in the long run.