This function often causes problems. It probably won't play the tracks you expect it to.
Instead, use
player.playMp3Folder(randomTrackNumber);
and place all your tracks into a folder called MP3 on the SD card.
I also wonder if you are making the code more complex than it needs to be. Do you plan to put more tracks on the SD card than will be randomly chosen? For example do you plan to put 30 tracks on the card, but select only 5 of them to play randomly, and the other 25 will never be played? Or will you put only 5 tracks on the card and any of them will be played, randomly.
If you plan to put only 5 tracks on the card and play any of them randomly, then your tracks[] array is not needed, and it doesn't matter if you use player.play() or player.playMp3Folder().