Answer
Leopold I became the heir apparent in 1654. This is because his father, Ferdinand III, had no surviving sons. However, Ferdinand III had three surviving daughters: Maria Anna, Maria Theresa, and Eleonora Magdalena. Leopold I was married to Maria Anna, so he became the heir apparent.