I changed the rear brake on a Commencal Meta Power (pretty similar frame cable routing), had to undo the motor and pivot it down to route the hoses. It took me about 5 hours to do both F&R. It turns out I did it just in time as one of the motor mount bolts was loose and I hadn't realised. Good luck! Well worth the upgrade, I went to Shimano Saints.
I'm gonna try tonighr to attach the new hose to the old one and just pull the new one through the frame. Should work without removing the motor I believe.