Nietzsche has a tenuous relationship with free will. His theories here are fairly difficult, conceptually, to grasp, and I certainly won't claim that I have a thoroughly complete understanding of it. Also, it's worth bearing in mind that it isn't unheard of to find contradictions across Nietzsche's various works. Even putting aside the very late stage in his life where he becomes maniacal, his books were written at different times, and you can see his thought developing and becoming more refined in the later books, which occasionally contradicts sweeping claims that he made in the earlier books. That's in part why academic studies of Nietzschean philosophy generally center on a single text.
But as I understand it, the point he's trying to make in Beyond Good and Evil is that there is really no such thing as free will. No one can ever be a truly free agent (i.e., no one can truly be sufficiently free to be morally responsible) because such would require that one be causa sui (or, the cause of oneself), and since we are not causa sui , we cannot be free agents.
There are a couple of different ways that he goes about proving this in BGE, but they're fairly complex and not particularly relevant here. As a short summary, the first is that it's logically impossible to be causa sui (merely claiming that the very concept is "fundamentally absurd" and "the best self-contradiction that has been conceived so far"), and the second is that, based on his previously-developed notion of human agency, that we don't have sufficient control over our actions in order to claim that we acted out of free will. Or, in other words, that human beings are not self-caused in a sense that is sufficient to underwrite ascriptions or claims of moral responsibility.
He argues that both our moral and religious traditions (particularly Christianity, of which he holds a particularly bitter resentment) conspire to prevent us from ever truly having free will. In fact, he says that what we possess are causally determined wills. One of the aphorisms he uses to prove this asks the question, "Does a Christian want to sin?" Nietzsche disagrees, arguing that a true Christian can never truly want to sin, thus concluding that the Christian never truly has free will, as he was never free in the first place to do whatever he wished.
However, in (primarily) Twilight of the Idols (and Genealogy of Morals), Nietzsche beings to develop a more positive, productive sense of free will, and more generally, freedom itself. He says that free will is not, in fact, characterized by the ability to do whatever you want, whenever you want, because if it were, it would be a meaningless concept. One who indulges their every whimsy is really just one who is a slave to her own impulses. Suffice it to say that Nietzsche doesn't think this is a particularly desirable state of affairs.
Instead, he asserts that true free will is more accurately characterized by ambition and achievement. Really, he says, it's the ability to set a goal and act in such a way as to achieve it. This is also known in his works as the "Will to Power" (not to be confused with the corrupted form later espoused by his sister). Striving to reach the highest possible position in life is the ultimate goal of the will to power, and is in fact itself a manifestation of the will to power. In other terms, the will to power is just agency free will, as opposed to deserts-based free will. And he takes such agency free will to be a rare achievement, as opposed to the natural endowment that is deserts free will, the most commonly conceived form.
Examined again in this light, it becomes apparent that the quote you've taken from TI is really just a restatement or reprisal of the will to power:
Freedom is the will to be responsible for ourselves. It is to preserve the distance which separates us from other men. To grow more indifferent to hardship, to severity, to privation, and even to life itself.
True freedom, from a Nietzschean perspective, is really the will to affirm and to be responsible for oneself. It requires struggle against hardship and an acceptance of life's pain and suffering in a positive, life affirming way (amor fati ). But it explicitly does not mean the denial of one's impulses and instincts. Indeed, it's the freedom from having to rely on them, but at the same time, the freedom from having to categorically reject them.
(In summary: I think that the two quotes are really talking about two completely different things, although Nietzsche labels them both "free will". In fact, there are two entirely different notions of free will at play here, one of which Nietzsche harshly criticizes and the other, he exalts.)