Maybe it's extra redundancy for all the electronics. Even small aircraft with glass cockpits have dual alternators and batteries.
Most aircraft only have one battery whether glass cockpit or not. In an emergency a ram air turbine provides backup electrical and/or hydraulic.
Based on the limited info I have seen the 787 has two humongous battery packs.