M. xanthus cells self-organize into clusters, aligned cell groups, at various stages of its lifecycle. Formation of these clusters is crucial for complex dynamic multi-cellular behavior of these bacteria. However the mechanism underlying the cell alignment and clustering is not fully understood. Motivated by studies of clustering in self-propelled rods, we hypothesized that M. xanthus cells can align and form clusters through pure mechanical interactions among cells and between cells and substrate. We test this hypothesis using an agent-based simulation framework where each agent is based on biophysical model of individual M. xanthus cell. We show that model agents, under realistic cell flexibility values, can align and form cell clusters but only when periodic reversals of cell directions are suppressed. However, by extending our model to introduce observed ability of cells to lay and follow slime trails, we show that effective trail following leads to clusters in reversing cells. Furthermore, we conclude that mechanical cell alignment combined with slime trail following by cells is sufficient to explain the distinct cell clustering behavior observed for wild-type and non-reversing M. xanthus mutants in recent experiments. Our results are robust to variation in model parameters, match with the experimentally observed trends and can be applicable to understand surface motility patterns of other bacterial species.