Two men have been handed prison sentences after forcing their dogs to fight a badger on farmland in Yorkshire.