Not necessarily. Philip already had a son, Carlos, from his first marriage to Maria Manuela of Portugal. While Carlos was Philip's heir apparent to the Spanish throne, Carlos eventually died before Philip (but after Mary).
Also keep in mind that Mary was 37 when she married Philip, and getting pregnant was also made difficult by Philip leaving to become king of Spain two years later.
Phillip was succeeded as King of Spain by his son Phillip III, who was born to Phillip II's fourth wife, Anna of Austria. Mary was succeeded as Queen of England and Ireland by her half sister, Elizabeth I.