Jack to mimic tracks, jesting (6)
I believe the answer is:
japery
'jesting' is the definition.
(both can mean silly behaviour)
'jack to mimic tracks' is the wordplay.
'jack' becomes 'J' (playing card abbreviation).
'to mimic' becomes 'ape' (ape can mean to copy or imitate).
'tracks' becomes 'RY' (abbreviation for railway).
'j'+'ape'+'ry'='JAPERY'
(Other definitions for japery that I've seen before include "Clowning" , "pantomime" , "April fool activity" .)