The defence would be that you copied from the public domain to make a derivative work, the other aspects -- timing, lyrics, repitition, instruments used, etc. -- would be where your copyright lay. You couldn't successfully sue someone for using that sequence of notes on your melody (common ancestor) but could if the result shared your timing or other aspects; provided those choices passed the bar for making a creative work.
But using the defence that a melody is public domain surely also invalidates your own copyright?