manipulation of string list
First /@
(GatherBy[MapAt[ToUpperCase, lis, {;;, 3}], Most] /. {{a__, "0"|"1"}, __} :> {{a, "1"}})
{{"a", "b", "X", "1"}, {"a", "f", "Z", "1"}, {"g", "a", "Z", "1"}}
Also
Tally[MapAt[ToUpperCase, lis, {;; , 3}], Most[#] == Most[#2] &] /.
{{a__, b_}, c_} :> {a, c /. {1 -> b, _ -> "1"}}
{{"a", "b", "X", "1"}, {"a", "f", "Z", "1"}, {"g", "a", "Z", "1"}}
and
SequenceReplace[Sort @ MapAt[ToUpperCase, lis, {;; , 3}],
{Repeated[{a__, _}, {2, ∞}]} :> {a, "1"}, ∞]
{{"a", "b", "X", "1"}, {"a", "f", "Z", "1"}, {"g", "a", "Z", "1"}}
This should also work:
#[[1]] /. {a_, b_, c_, _} :> {a, b, c, "1"} /; #[[2]] > 1 & /@
Normal[Counts[MapAt[ToUpperCase, lis, {All, 3}]]]