Minimum number of steps to sort 3x3 matrix in a given way
Since you are looking for minimal number of moves without any tricks, there is old good pattern for small exact problems.

0) treat your starting matrix as root.
1) enumerate possible moves, and perform them (copy matrix, save steps etc.).
2) keep performing step one for every resulting matrix until you find them ordered. This is minimal number of moves.
1+) optimization possible is to ignore the same matrices that you already have, block sliding ply in direction it came from.