A typedef can be be used as a task (if you set the adaptor and adaptto properties correctly); or as a data container (usually passed to a task).
A taskdef is a typedef that has the adaptor and adaptto properties already set for it to be a task; thus is is a shorthand (saves typing).
Usually, you want to use a typedef as a property container and taskdef as a task Here is a previous post with an example:
https://coderanch.com/t/419666/Ant-Maven-Other-Build-Tools/Arbitrary-nested-elements-Ant#1852011