I believe hasTrait() does account for Civ Traits.
That seems to work for me both for only leaders that are Agnostic (e.g. the Risen Emperor) and Civs that are agnostic (e.g. the Grigori.) At least, it does in Wildmana.
Code:
gc.getActivePlayer().hasTrait(gc.getInfoTypeForString("TRAIT_AGNOSTIC"))
That seems to work for me both for only leaders that are Agnostic (e.g. the Risen Emperor) and Civs that are agnostic (e.g. the Grigori.) At least, it does in Wildmana.