Testing gravity at the second post-Newtonian level through gravitational deflection of massive particles