how to display different menu according to postid?

You can use wp_nav_menu($args) to display different menus. Just pass menu ID, slug, name or object as $args['menu'] parameter.

if ( $post->ID == 2309 ) {
  $args = array(
    'menu' => 'some-menu'
  );
  wp_nav_menu($args);
}

There are also other available parameters that you can pass to the function, https://developer.wordpress.org/reference/functions/wp_nav_menu/