It's not just named after the duck in isolation. The designer-Sir Nigel Gresley-was an avid wild bird watcher and breeder himself, including rearing Mallard ducks. It's part of the reason a lot of the class was named after birds including Kingfisher, Wild Swan, Osprey and Bittern amongst others.