At the moment it seems to be impossible to enable scroll bars programmatically. The reason for that behaviour is that Android does not call either View.initializeScrollbarsInternal(TypedArray a) or View.initializeScrollbars(TypedArray a). Both methods are only called if you instantiate your RecyclerView with an AttributeSet.
As a workaround I would suggest, that you create a new layout file with your RecyclerView only:
vertical_recycler_view.xml
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Now you can inflate and add the RecyclerView with scrollbars everywhere you want:
MyCustomViewGroup.java
public class MyCustomViewGroup extends FrameLayout
{
public MyCustomViewGroup(Context context)
{
super(context);
RecyclerView verticalRecyclerView = (RecyclerView) LayoutInflater.from(context).inflate(R.layout.vertical_recycler_view, null);
verticalRecyclerView.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false));
addView(verticalRecyclerView);
}
}