Why do you build two catholic churches only 50 meters apart? Honestly, I don’t know. Fact is, in old cities you see that a lot. You have normal parish churches, churches of monasteries, churches built to commemorate important events and so on and so forth.
In this case the church on the hill has replaced an older church first mentioned in 1081. I suppose the rock with the original church has has given name to the town: Stein an der Donau means Rock at the Danube.