Modular perverse sheaves on flag varieties, II: Koszul duality and formality