Image transformations in torchvision.transforms work mostly on PIL.Images, so you would need to transform the tensors in train_images to Images first, apply the transformations, and transform the Images back to tensors.
E.g. this might work:
trans = transforms.Compose([
    transforms.ToPILImage(),
    transforms.RandomCrop(24),
    transforms.ToTensor()])