@Railo2 the short answer is: go with the
55mm chainline version of the Race Face 36T. Here's why.
The 34T chainring limit on the Trek Rail is specifically due to chainstay interference at the stock chainline. You've already noticed your Pilo 34T is running close to the chainstay, which tells me it's likely on a 52mm chainline.
Going to a 36T at 55mm chainline is exactly how Rail owners get around this, with people running that combo without issues.
The extra 3mm of offset pushes the ring outward just enough to clear the chainstay with the larger teeth. A reviewer on the Race Face product page itself confirmed that with a Rail, saying
"the chain stay clearance is a concern with regular Boost rings" but "this 55mm CL ring solves that issue with plenty of room to spare."
If you went with the 52mm chainline on a 36T, you'd almost certainly be kissing the chainstay, which is a recipe for damage and noise. The trade-off with 55mm is a slightly more acute chain angle on the largest cassette cogs, but
Trek themselves accept 53mm to 55mm chainline as the acceptable range, and in practice modern drivetrains handle this fine. You might find you just don't use the very lowest gear much anyway.
One thing to note: make sure you check the chainring is for your specific drivetrain. The Race Face Bosch Gen 4 Shimano 12-speed version is only compatible with Hyperglide+ chains.