well they can go hand in hand with each other but they're not primarily the sm thing
legal measures - mechanisms taken by agencies of the legal system (eg policies, legislation). and they can be enforced and implemented by the parliament, administrative bodies, etc. so this is specific mechanisms within the legal system
role of the law - includes the applications of the rule of law and other values to protect the rights of citizens and uphold responsibilities of the state (eg courts, police, the entire legal system in general). so this is the more holistic purpose of the legal system