sensor size and depth of field
The relationship of sensor size and depth of field is indirect.
The real relationship is between lens focal length and depth of field with a wide angle lens (short focal length) having better depth of field. Folks shooting with telephoto lenses have depth of field problems like crazy. Even f/45 isn't enough to create deep field depth with a 300mm lens on a DSLR.
So how does focal length interact with sensor size?
It's pretty obvious when you think about it. If you double the size of the sensor, then to get the same photo composition the lens needs to be twice as far from the sensor (focal length is twice as long) and the depth of field gets shallower. But if you halve the size of the sensor, for the same photo composition the lens needs to be half the distance from the sensor and the focal length is halved creating better depth of field.
So why would anyone who cares about depth of field use a DSLR? Well, there are other things that effect depth of field: aperture and distance of the camera from the subject.
The smaller the aperture (the hole through which light enters the camera) the better the depth of field. Aperture is measured in f-stops. f/2.8 is a much larger hole than f/4, which is larger than f/8, etc. A DSLR lens will often stop down (tighten the aperture) to f/32.
The closer the camera is to the subject the worse the depth of field. Assuming a camera can focus closely enough going from 12" away from your model train subject to 6" away will result in much noticeably worse depth of field.
There is a minimum practical aperture. Once the opening gets too small, diffraction effects where the light at the edge of the opening is bent and "scattered" become significant compared with the light that doesn't scattered and leads to a "soft" (not sharply focused) image. You'll have more control over this with a DSLR. The aperture in f-stops, also depends on focal length. While a decent DSLR lens will stop down to f/32, a compact camera may stop down to f/8. Both of these will yield much better depth of field than a wider aperture for that camera.
There are other issues. A DSLR usually has a larger sensor. The larger sensor is easier to carve up into individual pixels than a tiny sensor and for the same number of pixels the area of each pix will be larger in a big sensor camera than in a small sensor camera.
Larger pixel sites on a sensor tend to have much better noise characteristics. And large sensor cameras usually get the best out of a lens. This is why photos form an 8x10 view camera are generally much higher resolution than anything else out there. But those huge cameras also come with depth of field issues - lens if much further from the sensor (or film).
On the other hand, a compact camera may achieve decent depth of field at f/8 instead of f/32 so extremely low noise sensors and electronics aren't as necessary.
But overall, you'll find a good DSLR with good glass can take significantly better photos than most cell-phone cameras, all other things being equal and with good lighting. However, in the real world, the differences between a DSLR, a compact camera, and a cell-phone may not be so obvious. Technique on the part of the photographer plays a big role.
One thing a good DLSR does give that you're not going to find on tiny cameras or cell phones is good "handling". Is it easier to operate the camera? How fast is auto focus? How accurate is auto-focus? How accurate is exposure metering? How short an exposure is possible? How many frames per second can the camera shoot? Does the camera produce .raw (digital negative) files for best photo quality?
Against these is the issue of can you physically place a DSLR into a scene to get a shot from an unusual angle. A compact camera or cell-phone camera is definitely smaller and more maneuverable.
If you get serious about photography you'll probably end up with an arsenal of equipment - small cameras to larger camera.