I don't see it as a major issue - the lorry wanting to overtake indicates out and moves from their lane in the normal way. Presumably the automatic pantograph monitoring system detects once the lorry has moved far enough from the centreline and auto-drops it (or as someone suggested earlier, activating the indicator could also do this), with the vehicle instantly switching to battery power. Once the manoeuvre has been completed, the driver hits a button to redeploy the pantograph, which checks that it is correctly aligned, and then raises, switching the vehicle back to mains power. I would imagine there would be a 'Overhead power available' alarm that would 'ping' to remind the driver to deploy the pantograph - this could probably be automated, but for my mind this would be the option that is least risk.
Once nice thing is that there is an incentive to the driver to not do the manoeuvre if there is marginal benefit, so reducing the likelihood of elephant racing.