First part is:
public class Lab2 {
   public static void main(String[]args) throws Exception {
        Train train1 = new Train(3);
        Train train1Copy = train1.clone();
        train1Copy.carriages[0][0] = 5125;
        System.out.println("train1")
        System.out.println("Copyed");
        ... ...
    }}
Train is:
public class Train implements Cloneable {
    private int petrol, bananas, coal, grains, fertilizers;
    // количество вагонов, и груз в них
    int[][] carriages;
    public Train(int numOfCarriages) {
        carriages = new int[numOfCarriages][5];
        for (int i=0; i<numOfCarriages; i++) {
            petrol = (int)Math.round(Math.random() * 13);
            ... ...
            carriages[i][0] = petrol;
            ... ...
        }
    }
    @Override
    public Train clone() throws CloneNotSupportedException {
        return (Train) super.clone();
    }
    public String getPetrol() {
        String petrolText = "";
        for (int i=0; i<carriages.length; i++) {
             petrolText += i+1 + " carriage petrol= " + carriages[i][0] + "\n";
        }
        return petrolText;
    }
}
As I think, there could be some problems caused by constructor. And what I got in console is:
train1
1 carriage petrol= 5125
2 carriage petrol= 1
3 carriage petrol= 8
Copyed
1 carriage petrol= 5125
2 carriage petrol= 1
3 carriage petrol= 8
I watched some guides how to clone objects and as I see, my clone method is the same
 
    