Eastern forces and troops loyal to the Tripoli government fought on the outskirts of Libya’s capital on Wednesday as thousands of residents fled from the battle.