Why does it say that they were Kohanim?
Radak: They were officers of the Kohanim. He appointed Tzadok to be Kohen Gadol, from Elazar's sons, and Achimelech ben Evyasar, from Bnei Itamar, was second to him. He appointed Achimelech even though his father Evyasar was still alive, for we find that later Shlomo expelled him 1 from being Kohen (Melachim I, 2:27). It seems that David had commanded Shlomo to do so 2 , for David made Tzadok and Achimelech the Roshei Avos (of the Mishmaros - Divrei ha'Yamim I, 24:3).
David already demoted Evyasar when he could not answer with the Urim v'Tumim (15:24)! Since he once served as Kohen Gadol, he may not serve again as a Hedyot, for we ascend in Kedushah, and do not descend (Yuma 12b)! Surely he is no worse than a Zar, and may do Avodah for which a Zar is Kosher, e.g. Shechitah, flaying and dissecting (Yuma 27a). Perhaps Shlomo expelled him even from these. Or, perhaps David let Evyasar serve when Tzadok could not serve (Ralbag and Malbim (Melachim I, 4:4) say so after Shlomo banished Evyasar), and Shlomo totally expelled him from Kehunah. (PF)
Shlomo said that Evyasar should die for supporting Adoniyahu's rebellion, just he will not kill him, for he carried the Aron, and suffered with David when David fled Avshalom; rather, he banished him to Anasos (Melachim I, 2:26). We can say that in any case, he would have deposed him due to David's command. (PF)
Here it says that Achimelech was Kohen, and Serayah was scribe. In Divrei ha'Yamim I, 18:16, it says that Avimelech was Kohen and Shavsha was scribe!
Radak: Each had two names. The names Achimelech and Avimelech are similar.