The latter: `$HOME/lib` precedes (overrides) `/grid/common/lib`. By convention, environment variables which give a list of colon-separated directory paths are from _left-to-right_.
POSIX lists several "path" variables, all are processed left-to-right, including `CDPATH`, `NLSPATH`, `PATH`. Oddly it does not mention this one (which is more often used than several of the variables listed).
Usually the documentation does not say left-to-right, but just says "order", assuming the reader's cultural bias fills in the rest of the details:
* Program Library HOWTO: 3.3.1. LD_LIBRARY_PATH
* 4.3.2 LD_LIBRARY_PATH Environment Variable
* In which order does the linker process the library directories?