Their routing algorithm runs a shortest path (i.e. http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) algorithm on a graph data structure that represents the road network. In order to exclude a particular road segment, you'd need to set the weight of that segment to a very high value so that the algorithm wouldn't use it in the path.

There isn't any way to tell Google's routing algorithm to use a client defined weight for a given road segment. You'd have to alter the server-side graph structure and I doubt Google will let you do that.