If you want to just record the video and view it later, there are many options available (from expensive GoPros or cheap "spy" pen cameras on eBay).
But if you want a live video feed, it gets more difficult (especially in N scale or smaller). Back around 2004, there was an advertisement in Model Railroader Magazine for a Japanese company selling a 2.4GHz miniature camera and receiver, small enough even for Z scale. It was quite pricey (over $250), but I bought one and easily installed it in a hollowed-out dummy Kato P42 loco. That model was featured in Kato's Photo Gallery (but I checked and the gallery is either shut down or temporarily offline). But the photos are saved on the Wayback Machine. Go to
https://web.archive.org/web/20161222052149/http://www.katousa.com/gallery/albums.php?set_albumListPage=6 then scroll down to Peter Wisniewski's model, and open up the gallery.
The video (no sound) is rather low-end for today's standards (640x480), and the signal strength is low, causing dropouts as the model traverse the layout, but it is a live feed. So if you have a WiFi throttle and a way to stream the vireo remotely, you can drive your trains from anywhere in the world.

Since that time I have done 2 more installations (one for a friend and another for my NTRAK club) and the camera is always a big hit with the spectators at the train show. I have also recommended it to members here and
@eric220 has installed and used in on his last layout.
Here is one of the videos I made with hat camera on friend's layout.
Last time I checked with that camera manufacturer (RF System Lab in Japan) was in 2016, so I'm not sure if they still make these. The train camera is not their main business (I suspect some employees do this on the side). They are in a business of making industrial and medical cameras.
I'm also planning on experimenting with the 5.4GHz cameras for drones. But those are a bit larger, so I won't be able to fully hide the camera inside a N scale model.