For the next 3 years, the F10 will be less trouble, warranty picks up the bill, depreciation sucks.
3-6 years they'll be about about the same amount of trouble, but the F10 will be more expensive and not nearly as DIY-able.
6-10 years, the F10 will be more expensive for YOU to maintain than the E39.
After 10 years, I'm betting the F10 will be worth less than your E39 and more expensive to maintain. At some point the electronic modules for the F10 that require replacement will total the car.