No.
The St. James medal was not for protection, it was to be a reminder of where I was headed (to the tomb of St. James) and why I was there.
As to ancient protection that was provided by certain knights.
“...the Spanish Order of the Knights of Santiago of the Sword (Caballeros de Santiago de la Espada), founded in 1167. Their original aim was to fight the Moors to protect Christianity. Their duties extended to guard the pilgrimage route and they patrolled the roads to protect and provide hospitality to pilgrims......”
Today, protection is provided by the Guardia Civil police officers and local police along the route.