This is unfortunately a very difficult problem. So in the general case, the answer is unfortunately no. Looking at $DISPLAY isn't sufficient as that just means that there is a local X server in some form (like xrdp), not that the user is physically at the machine.
The only option I'm aware of is ConsoleKit, which has a "is-local" attribute. Unfortunately I don't know any easy way to check it from a shell script. You might be able to do something using "ck-list-sessions".
Also note that it had a bug at one point where you could easily trick it to thinking a remote session was local.
If security isn't that important, then I suggest checking if xrdp sets some special environment variables that are only present for that kind of session. Just run "env" in a terminal and you'll see what's available.