UIDs
are available in the public dumps of timetable data that ATOC has made available to the public in recent times, though these data dumps are only really of practical use to those who have experience in bulk data processing and database management. They're not intended for "end user" use though. See
This thread for a current discussion on this topic.
If ye just want to look up UIDs for a few trains though,
Open Train Times run in "advanced" mode (Click the crossed tools in the leftmost tab on arrival) will give ye this info. Ye can look-up trains by departure place/time, headcode, or departures by station and time and - Once ye have found thy desired train and loaded its details - The UID appears as part of the page URL prefixed with the letter P.
HTH!