In general, pending writes really don't get cached in system memory for very long. Programs can explicitly request the operating system to flush writes to the disk; when this is requested, the write will propagate through the entire cache stack until it is on non-volatile media:
- It'll get pushed from RAM to the RAID controller
- The RAID controller will push it from its flash cache to the HDDs
- The HDDs will push it from their onboard write cash to the physical media (the platters)
If all the drivers are working correctly and programs are calling the appropriate functions when data important to them needs to be written to disk, then it is fairly difficult to lose data by having it hang around in system RAM.
NTFS also has a behavior whereby it will automatically commit any pending un-flushed data to the hard drive every so often; I believe the interval is about 5 seconds. So even if a program misbehaves and writes important data without explicitly telling the operating system to flush it to disk, NTFS (the filesystem) will catch it in a short period of time and push it out to the media, anyway.
If you are shutting your system down cleanly, which means gracefully calling a routine to go through the shutdown or reboot process without holding down the power button or "forcing" it off, then it should not be a problem with dirty pages in RAM. By design, during a graceful shutdown, dirty pages in RAM are written to the non-volatile media several times due to explicit commands issued by the operating system.
In fact, you're far, far more likely to run into issues with write cache on the RAID controller itself not being flushed to the disks. But since you said you have a BBU, the chance of even that happening is pretty low.
What may be happening is that your system could be crashing upon shutdown. If a driver is not behaving properly, or a program is inducing a driver to misbehave, and you get a bluescreen right before shutting down, it may be failing to flush all the pages from RAM to the disk controller, or the controller may think that it needs to throw out the writes rather than flushing them to disk. This would be a rather unusual behavior for a device robust enough to come with a BBU.
You should definitely try making sure you have the latest device drivers for your RAID controller, and apply any firmware updates at both the RAID Controller and Hard Disk levels. Also, apply any motherboard driver or BIOS updates that may impact the reliability of the PCI or PCI Express bus.