how to return a db_query as an option list and display it
You can make use of DatabaseStatementInterface::fetchAllKeyed(), but as you only need 2 columns it would be wise to change your query slightly. Essentially you want to select just one for the identifier, and one for the label. Something like this:

$sql = ' 
    SELECT realname.uid, realname.realname 
    FROM {users} users 
    INNER JOIN {users_roles} users_roles ON users.uid = users_roles.uid 
    LEFT JOIN {realname} realname ON users.uid = realname.uid 
    WHERE users.status &lt;&gt; :status AND users_roles.rid = :rid
    ORDER BY realname.realname';

$args = array(':status' =&gt; 0, ':rid' =&gt; 5);

return db_query($sql, $args)-&gt;fetchAllKeyed();


That will return an array with the 1st column (uid) as keys and the 2nd column (realname) as values, which you can use verbatim as options for a form element.

You don't have to return just 2 columns from the query, as fetchAllKeyed() allows you to specify the index for both key and value; but as you're not using the data for anything else, it makes sense to avoid the overhead of the extra columns.

Slightly unrelated: you shouldn't call exceute() on the return from db_query(), as the query has already been executed by that point. You can either use one of the helper methods like fetchAllKeyed(), or iterate directly over the values, e.g. 

foreach (db_query($sql) as $row) {
  // ...