Correlation between Rushing and Time Remaining on a Task?
Solution 1:
No correlation between time remaining and rush failure percentage
The in-game help mentions that the probability of a rush failure decays over time. Attempting a rush, whether it succeeds or fails, will increase the probability of a rush failure in that room, but this is a one time increase and it starts to decay again after that. There also seems to be a lower limit on rush failure. likely based on Luck and the appropriate SPECIAL stat for the room. The lowest I've seen is 21% failure chance on a room that I haven't rushed in days. James reported seeing as low as 16% with a maxed out, very lucky water treatment plant.
In my experience, the failure decay rate is so small that you probably would not notice it over a few minutes (the normal task completion time for a well populated room), but it becomes noticeable over a few hours. After spiking the failure chance in a room to around 50% right before bed, I woke up the next morning with the failure chance back down to upper 20s/lower 30s. This seems to indicate that it is based on elapsed time rather than decaying after a room is harvested.
When you couple this with the fact that the timer is reset to max after a rush is attempted, rushing a room with a few seconds left is not as resource effective as harvesting the resources, then attempting the rush when the timer is full. In that case, you save a lot of time if you succeed and don't lose as much time if you fail.
tl;dr
It seems to be a percentage calculated when you click the rush button, regardless of how much time is left until the room produces resources. Rush failure percentage chances slowly decrease over time, but this is noticeable over tens of minutes and hours, rather than seconds. If you want to maximize the amount of time your rush saves, rush right after you collect, when the room timer has a lot of time left.
Solution 2:
Per my experience with the game observing various situations and reading in many forums, there is absolute no relation in the amount of time left to complete a task.
A simple experience would be trying to run a rush when it is 10 minutes away from completing the task. Do not rush... just click the button and check the percentage. 9 minutes later, check again the rush percentage. I made that test many times and they were all the same.
So, I'm pretty sure the amount of time does not have any influence in the success percentage.