The simplest way to do this is to use a leader tab:
- Set up a right tab at the right page margin.
- In the leader character box, use an underscore (_).

That may not have the quality you want (line thickness, some separation of the underscores) but it's simple and automatic.
I think the only other way to do it is with a Character Style applied by a GREP style. Create a Character Style using Underline Options that give you the desired line weight, color, style, etc. Call it RIGHT LEADER.

Apply this style to the portion of the line with the tab, either manually, or using a GREP auto style:
