Hi!
I think you will not be able to play as those characters in the real n64 (although I'm not sure if it's possible or not). You will find some cheats for this game in that page:
http://www.totallyfightinggames.com/super-smash-brothers-series/ssb.htm
Playing with them in the computer is easier, you only have yo add those cheats you have seen to 1964. (You should have the SSB USA rom).
Open 1964, and go to Edit->Cheat Codes, or press Ctrl+C. Then a new window will appear.
Now, go to "Enter new code" at right, and write "P1 is Master Hand in Story Mode" in "Name" edit box, and type below the code: 800A4B3B000C. In country box select "USA". Then press the "Add/modify" button. Look at the picture:
Finally, close this window by pressing OK.
Now, start playing SSB by double-cliking it. Choose 1Player mode, and select Mario. Then, when the VS screen appears, press Ctrl+C: the cheats window will appear. Look at the left, at the "Codes for this game" list, and scroll down to the last item. It should be the one you have created, "P1 is Master Hand...". Enable it by double-clicking this item (a '*' character will appear at the left of the item), and press OK to close the window.
Then the fight should start with you playing as master hand vs Link...
If you want to play as Metal Mario, follow the same steps. With the code
P1 Is Metal Mario In Story Mode
800A4B3B 000D
You will also find these cheats in Project64.