What are you consulting to find that the correct replacement for 'them' in formal writing is 'him' here? There isn't any College of the English Language to make authoritative prescriptive statements, and the Chicago Manual of Style at least has been against the use of 'him' here for several editions.