Indian farmer wins train in legal fight with railway