Get posts in taxonomy randomly

You have syntax error in tax_query.

'tax_query' => array(
    array (
        'taxonomy'      => $term->taxonomy,
        'field'         => 'term_id', // this is default value, so can be ommited
        'terms'         => $term->term_id,
    )
)

As you can read in Codex, possible values for field parameter are: term_id (default), name, slug or term_taxonomy_id.

In this question you can read about another method of getting a random post.