Judge gives father custody of son after mother arrested