Firstly, the exact position of the Pontifex Maximus in the Roman State Religion is far more complex than at first glance. In the Republic, the Pontifex Maximus was the Chief Priest of the College of Pontiffs, but there were other groups and hierarchies of religious leaders as well as the Pontiffs. There were the three flamines maiores (Major Priests) who were also considered the most important religious officials in Rome, since they were responsible for the three Chief Roman gods of the Archaic Triad. And the Flamen Dialis was considered the most prestigious of these three, since he served Jupiter, followed by the Flamen Martialis (Priest of Mars), and then the Flamen Quirinalis (Priest of Quirinus), all three of whom were placed higher in order of honour and prestige than the Pontifex Maximus. But even the Flamen Dialis was not recognised by the Romans as holding the highest honour and prestige in the ordo sacerdotum (Order of Priests), which denoted the seating arrangements at banquets and similar positions of honour. The most honoured was the Rex Sacrorum (King of the Sacred).
So the Pontifex Maximus was only the fifth most prestigious religious leader in Rome, and not only this but he was only the head of one of the four separate Religious Colleges of Rome. Each of the others (Augures, Quindecimviri, Epulones) had their own separate hierarchy, roles, and importance, over which the Pontifex Maximus had no authority. In fact, the Pontifex Maximus, despite being rather high up in terms of prestige, traditionally had little authority connected with it. It was an honoured position, but it was somewhat of a poisoned chalice for patricians, as it would be a dead end for their advancement in the cursus honorum. Caesar got around the stringent restrictions traditionally associated with the office by some rather illegal moves. But the position itself was usually a figurehead title.
However, since Julius Caesar held the title of Pontifex Maximus, his heir Augustus eventually took it as one of his own titles and in so doing, it became associated with the Emperor himself. This artificially elevated its importance beyond its traditional use, and the role attached to it. The title became an Imperial one, and was held by Emperors, even Christian Emperors, until 382 when Gratian formally renounced it.
For the Papacy however, the history is even more complicated, the first mention of it by Tertullian in 220 was used ironically to refer to a Bishop peremptorily overreaching his authority. After Gratian renounced the title, it may have been bestowed on Pope Damasus I, but other sources claim it was first used by Pope Leo I. Other sources claim it wasn’t used to refer to the Pope regularly until the 15th century, and then only as a renaissance title of honour, and not an official title.
In the early church, the authority of the Pope was taken to originate from their position as successors of Peter and Paul, and not due to Roman law. While the title of Pontif was often used as it just means ‘Priest’, the title of Pontifex Maximus was barely used at all, or left unused. The official list of Papal titles published in the Annuario Pontificio never included it. Instead the closest is the fourth Papal title: Summus Pontifex Ecclesiae Universalis ("Supreme Pontiff of the universal Church). Summus Pontifex was also used to refer to other Bishops throughout the first millennium. Hilary of Arles (d. 449) was called summus pontifex, and Lanfranc (d. 1089) was styled primas et pontifex summus. This title may therefore have been used solely as a reference to each bishop being a ‘High Priest’, in the Jewish tradition, rather than linking them with the Roman pagan religion of the College of Priests.
The exact link between Roman state religion and the Papacy is therefore extremely confused and unclear. The structures and hierarchies of Roman religion were very different from the strict single line of authority of the Papacy as the Roman state religion were much more diverse and decentralised. The Papacy’s treatment of the title Pontifex Maximus shows, rather than a desire to inherit the authority and institutions of the old Roman state, an early reluctance, and even fervent rejection of these forms and authorities. It was only a millennium after the Western Empire and its religion had vanished that the papacy felt comfortable regularly using terms once associated with its pagan religion, and even then, not officially.