In response to the diverse and complex nature of cracks in ballastless track slabs, existing crack detection methods suffer from insufficient extraction of crack target features, discontinuity detection and low accuracy. A crack detection enhanced method is proposed based on dynamic snake convolution and deformable attention Transformer. Initially, the approach enhances the ResNet-50 feature extraction backbone by using a dynamic snake convolution on the basis of the Mask2Former segmentation model. The dynamic snake convolution, with its continuous prediction capability, improves the feature extraction network's ability to fit the geometric features of diverse ballastless track cracks, enhancing the extraction of crack features and overcoming discontinuity detection issues. Subsequently, a deformable attention Transformer decoder module is designed to enable the model to dynamically adapt to changes in local features of ballastless track cracks, in order to enhance the ability to capture global contextual information and improve the accuracy of crack recognition. Furthermore, an improved feed-forward network (FFN) is incorporated into the Transformer decoder to learn local information around the cracks, facilitating more accurate capture of local details and improving detection accuracy. Finally, the output of the Transformer decoder is fused with the pixel decoder output to obtain the crack detection results. Experimental results demonstrate that the proposed method accurately detects cracks of various shapes. It achieves a 6.34 percentage points increase in average accuracy, a 14.47 percentage points increase in average recall, and an F1-score of 94.30% compared to the original Mask2Former model. The proposed method exhibits superior performance in the detection of surface cracks on ballastless track slabs, enhancing detection accuracy and outperforming comparative methods in both subjective and objective evaluations.