Conditional score-based diffusion models for solving inverse problems in mechanics