Almost any astronomy processing software does this for free, because when you stack a whole load of images it rejects outlier pixels (e.g. a trail present on only one image out of hundreds).
It then usually gives you an image of both the combined success, and an image of just those pixels that were rejected. So, this.
I was thinking the field of astronomy would need to survey the satellites, in order to make sure it doesn't interere with any of their observations of the stars.
So, they would erase the stars, but only to create a satellite mask, generally speaking.
Actually, this is pretty common for non-scientific astrophotography! Erase Stars -> Edit background and stars colour, contrast etc separately -> Recombine!
It then usually gives you an image of both the combined success, and an image of just those pixels that were rejected. So, this.