Both terms are correct. Sometimes a younger male goat is referred to as a "billy," while an older male goat is called a "buck." Both terms are correct and are interchangeable. A female, btw, is a "nanny."
Either buck or billy is correct when referring to a male goat. However, billy is specific to goats, whereas buck also applies to other animals such as deer and rabbits.