IR Properties of Yang-Mills Theories from the Batalin-Vilkovisky Formalism