A lawsuit arguing elephants should be freed from a zoo has failed in court, with the judge ruling the "majestic" mammals do not have the same rights as humans.