The reason that Git behaves like this is explained well in the answers to this question:
https://softwareengineering.stackexchange.com/questions/194788/why-doesnt-git-merge-adjacent-lines-without-conflict/378258#378258
Essentially, because you need the neighboring lines to provide context to the change (you can’t just use line numbers, because something may have been added or deleted above), if the lines around it have changed you usually don’t want Git to just naively continue with the merge. User Arsen7 gives a good example in that thread of how this could go badly wrong.
However, I agree with you that sometimes this is quite annoying, so I wrote a custom merge driver that can resolve such conflicts during merging/rebasing. It’s designed to be interactive, because I always want to check that it’s going to do the right thing before going ahead, but you could easily modify it not to be if you’re confident it’s going to work.
If you’re interested, the script is available on GitHub under a GPLv3+ license:
https://github.com/paulaltin/git-subline-merge