Yes... remove them from phalanx mode until they enter the city, then replace them into the mode if possible. A phalanx marching down a tight avenue can actually be a dangerous proposition. In the worst case scenario you will have 120 armored swordsmen (depending on unit size) fighting in the assault rather than a Phalanx which is not a bad proposition anyway...