Both words mean the same thing (a sickness), but 'ailment' (by definition) is more likely used to describe a minor illness e.g. a stomach ache, where as 'illness' is a broader term and can be used for any type of sickness and possibly more long term sicknesses e.g. flu, cancer