The duty and authority of attorneys general will vary from state to state. Generally, they have the duty and authority to defend the constitutionality of statutes. In some states, the AG is the exclusive authority to do so. In other states, legislators or someone else may have some standing to do so. On rare occasion, an AG may ask a statute be declared in violation of the state or federal constitution. From our perspective, the problem is that the law is still unsettled in many respects and an AG may feel he or she has more responsibility to continue defending a statute until the U.S. Supreme Court answers some of the questions.
In many states, AGs are elected officials exercising independent judgment as to how far they should go to defend the constitutionality of a statute. In others, they are appointed by governor. In Tennessee, the AG is appointed by the state supreme court. If appointed by the governor, an AG is obviously more heavily influenced by the governor. A quick Google check reveals that the Maryland AG is elected.