Culy notes the awkwardness of v3b where three nouns with verbal ideas are all linked together. The phrase is best understood thusly:
βάπτισμα – accusative ms; direct object of κηρύσσων “preaching a baptism”
μετανοίας – genitive fs; genitive of apposition (there could be multiply ‘types’ of baptism, but John preaches one ‘of repentance’). Culy et al. have “characterised by or associated with repentance”, p103)
εἰς ἄφεσιν ἁμαρτιῶν – prep + accusative fs + genitive fp; purpose clause “with the purpose of forgiveness” + objective genitive (it is the sins which are forgiven, they are the object of the forgiveness).