Not always. In claims against public authorities, it is necessary to prove the injury, the causal link between the defect and the accident, and that there is no legal duty to bear the damage.
There may be grounds for a claim if there was a preventable defect or a lack of due care, and the Spanish Consumer Law (TRLGDCU) establishes the general liability regime for service providers towards consumers.
It is not always essential to have everything, but in these cases evidence of the location, the defect, and the link to the injuries is decisive.