There are two things messing your code and both are located in this line of code:
subLayer.setSQL(query.replace('SELECT * FROM rohingya_entry_points_1', 'SELECT * FROM rohingya_entry_points_1 where crossing_cost < "50000"'));
The first is a typo. You need to get rid of the "..."
, numeric values are not strings (do notice that string values are also quoted with single marks in PostgreSQL). Secondly and more key is that the first/original piece of SQL you want to replace need to be in lowercase. Why? Because your original query is like that, as you can see when consoling log. If not, the replace js method is not going to find anything on that query string. So the right code is as follow:
subLayer.setSQL(query.replace('select * from rohingya_entry_points_1',
'select * from rohingya_entry_points_1 where crossing_cost <
250000'));