@variable(model, x[1:2, 1:2])
makes a 2-by-2 matrix of variables. It looks like you want
@variable(model, P[1:size(branch, 1)])
P[3] # Corresponds to (4, 5, 0.2)
or
S = [(branch[r, 1], branch[r, 2]) for r = 1:size(branch, 1)]
@variable(model, P[S])
P[(3, 4)] # Corresponds to (3, 4, 0.1)