Just run away and don’t attack any: attacking them cause the ones in a 32-block radius to get angry. Run until they stop attacking you (about 40 blocks).
An aggravated zombie pigman now become passive after 20 to 39.95 seconds, although they continue to attack until the player gets outside their aggressive distance. Zombie pigmen now have an attack animation. This shows only when a zombie pigmen is holding a weapon.