it was due to a server issue, when I run composer update command it taking wrong PHP version due to some server configuration. so I just download composer.phar file for run composer update using PHP version and it worked. for me, bellow command working php composer.phar update
Error come only whenMagento 2.3.1 required php 7.1 version if version is less thanthen php 7.21 then it give error in my case default php version was 5.6 something so it giving error