Are you sure ATC said "MAINTAIN runway heading"? It should have been "CONTINUE runway heading". Only altitudes/flight levels are "maintained". And yes, once the instruction to continue a heading is given, that cancels all previous heading instructions including the SID, and you continue that heading until otherwise instructed.