I think the formal charges apply only to the atom, not the molecule. Otherwise, given that the two molecules have the same amount of electrons, wouldn't every single possible structure for a molecule have the same formal charge? The first structure's atoms all have formal charges of 0 whereas the second structure have two that are not zero.