Bill has the right answers, but a few more details. FRA rules prohibit crewmembers from using electronic devices of any kind, with exceptions for work related items. So you cannot use a cell phone, camera, etc. You can, of course, use the railroad radio. You can, with some restrictions, use your cell phone to contact the dispatcher on company business. This is done to prevent distractions. Several accidents have been blamed on that, but the one that caused the rule to be passed was a Metrolink collision. More details on that can be found here:
http://en.wikipedia.org/wiki/2008_Chatsworth_train_collision
A passenger would legally be allowed to shoot video if he is not acting as a crewmember. Since you have pretty much no reason to be in the cab of a locomotive, and there are lots of risks, from distracting the crew to, I guess, a terrorist taking over the train if you want to go to extremes. More practically, the railroad gets zero benefit from you being there and lots of risk. Cab rides have pretty much always technically been prohibited or at least restricted, but "back in the day", you could fairly easily talk your way up there. Now it's impossible for all practical purposes. Unless there are unusual circumstances, the employee(s) doing it are quite likely risking their jobs.
Things are different of course on shortlines and tourist railroads. Many tourist railroads allow cab rides, and you can shoot video from the cab.